MySQL Query: Online total users

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jca
    Member
    • Mar 2005
    • 39

    MySQL Query: Online total users

    I'm trying to set Online total users to any X amount at certain date via a MySQL query as described here:



    Run Query to Reset Count to *
    Online total users to any X amount at certain date
    # replace vbb_ with your vB table prefix Example: [vbb_datastore] if non leave blank
    # replace X with new total
    # replace date with Unix timestamp Example: 1167991932 = 01-05-2007 10:12:12

    Code:
    UPDATE datastore SET data = 'a:2:{s:9:\"maxonline\";s:2:\"X\";s:13:\"maxonlinedate\";s10::\"date\";}' WHERE title = 'maxloggedin';
    We ran this query (with our 512 total users and May 15 2008, 08:51 PM date):

    Code:
    UPDATE datastore SET data = 'a:2:{s:9:\"maxonline\";s:2:\"540\";s:13:\"maxonlinedate\";s10::\"1210841460\";}' WHERE title = 'maxloggedin';
    And got a 1 row affected result message. However, the forum doesn't show the new setting and simply resets to whatever the current total users as the most users online. We tried running various Update Counters after the query. What are we missing?

    What Update Counters (if any) should we run after this MySQL query?
    jca
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    It is slightly different in the latest version. Try this:

    UPDATE datastore
    SET data = 'a:2:{s:9:\"maxonline\";i:540;s:13:\"maxonlinedate\";i:1210841460;}'
    WHERE title = 'maxloggedin';

    Comment

    • jca
      Member
      • Mar 2005
      • 39

      #3
      Thanks for the help. Tried the new query you mentioned, but got the same result.

      1 row affected message. Did not affect the Most Online and it reset to current active users as the most online just as before.

      Do I need to run a specific "Update Counter" after this query?
      jca

      Comment

      • Jake Bunce
        Senior Member
        • Dec 2000
        • 46598
        • 3.6.x

        #4
        There are no associated counters. This works on my test forum. I don't know what the problem could be. Maybe it's a problem with a customization. Try disabling your plugins:

        Admin CP -> vBulletin Options -> Plugin/Hook System

        Also run a file check to look for customized files. Upload the original files if any problems are reported:

        Admin CP -> Maintenance -> Diagnostics -> Suspect File Versions

        Comment

        • jca
          Member
          • Mar 2005
          • 39

          #5
          Checked for any conflicts or suspect files. Don't appear to be any.

          Is this something I could try editing directly via phpMyAdmin rather than the vB query window?

          I can see the field by browsing through the table structure > datastore > maxloggedin.
          jca

          Comment

          • Jake Bunce
            Senior Member
            • Dec 2000
            • 46598
            • 3.6.x

            #6
            I think I see the problem. The line wrapper on this forum is inserting a space in the second line of the query, right in the middle of the serialized data. Using the CODE tag prevents this. Try copying and pasting this query:

            Code:
            UPDATE datastore
            SET data = 'a:2:{s:9:\"maxonline\";i:540;s:13:\"maxonlinedate\";i:1210841460;}'
            WHERE title = 'maxloggedin';

            Comment

            • jca
              Member
              • Mar 2005
              • 39

              #7
              Ah, that seems to have worked. Thank you so much for your help.

              By the way, is there an updated thread for Run This Query To: version 3.7.x since I was looking at an old query in the 3.0.x thread that no longer applied (in this case)?
              jca

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                I don't know of any updated version of that thread.

                Comment

                • Alfa1
                  Senior Member
                  • Dec 2005
                  • 4165
                  • 3.8.x

                  #9
                  Please delete. I will post my question in the 3.8 forum.
                  I buy 420 forums

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...