Announcement

Collapse
No announcement yet.

Any reason my user total might be out of sync?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Any reason my user total might be out of sync?

    I've got like 4000 members on the main page count, but when I'm in the CP, I'm only showing about 3840.

    Any reason why the discrepancy might be there?
    Jamie Sandford, editor
    Maxima.org,
    "The Home for Maxima Enthusiasts"
    http://www.maxima.org
    ------------------------------------------

    Rolling backup shell script (v2.0)
    Code to fix error when creating custom profile fields (v2.0b2)
    Code to make a bargraph rating instead of stars (v2.0b2)

  • #2
    James,

    It's possible that it's because you've deleted members along the way?

    I was wondering the same thing as my total number of registered members in the Forums, shows one number, but the latest registrant is a number 5 less than the total. It's because I've removed 5 members in the past.
    Rob

    Comment


    • #3
      I figured it out....

      The number showing up on the index.php page is merely the highest userid assigned to date and doesn't take into account that you could've deleted hundreds of users along the way. Not sure how you get around that unless you create a table that updates a total user count everytime someone new joins. That way you don't have to do some intensive counting query for each index.php page load.
      Jamie Sandford, editor
      Maxima.org,
      "The Home for Maxima Enthusiasts"
      http://www.maxima.org
      ------------------------------------------

      Rolling backup shell script (v2.0)
      Code to fix error when creating custom profile fields (v2.0b2)
      Code to make a bargraph rating instead of stars (v2.0b2)

      Comment


      • #4
        Re: I figured it out....

        Originally posted by JWS
        ...doesn't take into account that you could've deleted hundreds of users along the way.
        Um, actually it does. Trust me I've seen this work. I was helping a guy with his forums the other night, and we started over twice importing from the UBB and his lowest user regged number was 4190 or something in the four-thousands when we were done. However, on his front page, it said he had ~1900 members, which was correct. If you look at the very top of index.php, you should see the function that counts the number of members.

        Comment


        • #5
          Re: Re: I figured it out....

          Not on mine it doesn't. I just looked at my main page and it's showing 4047 users. When I go into CP, and go to Users -> Find -> List all users, I get 3873.

          Not sure where the discrepancy is coming in, but there is one nonetheless.

          Originally posted by tubedogg


          Um, actually it does.
          Jamie Sandford, editor
          Maxima.org,
          "The Home for Maxima Enthusiasts"
          http://www.maxima.org
          ------------------------------------------

          Rolling backup shell script (v2.0)
          Code to fix error when creating custom profile fields (v2.0b2)
          Code to make a bargraph rating instead of stars (v2.0b2)

          Comment


          • #6
            Re: Re: I figured it out....

            And now when I look at the actual code in index.php to do the counting, it looks like:

            Code:
            $numbersmembers=$DB_site->query_first('SELECT COUNT(*) AS users,MAX(userid) AS max FROM user');
            $numbermembers=$numbersmembers['users'];
            One would think that this would do it (i.e. count the number of users), but it seems like it's displaying the highest userid instead.


            Originally posted by tubedogg


            Um, actually it does. Trust me I've seen this work. I was helping a guy with his forums the other night, and we started over twice importing from the UBB and his lowest user regged number was 4190 or something in the four-thousands when we were done. However, on his front page, it said he had ~1900 members, which was correct. If you look at the very top of index.php, you should see the function that counts the number of members.
            Jamie Sandford, editor
            Maxima.org,
            "The Home for Maxima Enthusiasts"
            http://www.maxima.org
            ------------------------------------------

            Rolling backup shell script (v2.0)
            Code to fix error when creating custom profile fields (v2.0b2)
            Code to make a bargraph rating instead of stars (v2.0b2)

            Comment


            • #7
              While that code does select both the total and the highest ID the one that is used is the max total, hence the line below it.

              Comment

              Loading...
              Working...
              X