Reset user ID's?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • cbiweb
    Senior Member
    • Apr 2004
    • 2658
    • 4.1.x

    Reset user ID's?

    A client has previously deleted all user accounts, all threads, and everything else related to the forums he once ran. It is an empty shell, basically. Now he is going to reopen the site, and I'm redecorating .

    Whatever he did, the result of deleting all user accounts had left him as the only one, with the ID number being 415. I've now added myself, which makes my ID number 416.

    Is there a query I can run that will reset the ID's back to 1 and 2? When the site starts taking on new members again, it would be nice to have them starting low like normal.
    ~ Life isn't always fair, but you can be. ~
  • Jose Amaral Rego
    Senior Member
    • Feb 2005
    • 11058
    • 1.1.x

    #2
    Fresh installation would probably be your best bet, and I do not think you need queries to accomplished this.

    *Edit
    One more answer to this question of yours
    Last edited by Jose Amaral Rego; Fri 2 Dec '05, 11:11pm.

    Comment

    • Lats
      Senior Member
      • Mar 2002
      • 3671

      #3
      Try this query...
      Code:
      ALTER TABLE user AUTO_INCREMENT=1
      That will reset the AUTO_INCREMENT value to 1 or what ever the highest current value in the table is +1
      Lats...

      Comment

      • cbiweb
        Senior Member
        • Apr 2004
        • 2658
        • 4.1.x

        #4
        Lead_Weight: Thanks! That link was hlepful. I used phpmyadmin to change the User ID's, then ran the "Fix broken user profiles" update counter in ACP. Works perfectly.

        Lats: My next question (about proper incrementing of new members) was answered by your post. Thank you!
        ~ Life isn't always fair, but you can be. ~

        Comment

        • cbiweb
          Senior Member
          • Apr 2004
          • 2658
          • 4.1.x

          #5
          hmmm, something odd... on the forum home page where it displays the newest member, which is me, the link points to my old user ID, which of course no longer exsists. It is still linked to ../member.php?u=416 when it should now be ../member.php?u=2

          The 'My Profile' link on Quick Links is correct, but not the newest member link.

          The strangest part is that my client's ID is fine; it was changed over with no problem. So why didn't mine?
          ~ Life isn't always fair, but you can be. ~

          Comment

          • Jose Amaral Rego
            Senior Member
            • Feb 2005
            • 11058
            • 1.1.x

            #6
            I have read that it does not work and even if you change every instance in where your user id is used, it can throw your database off and you will get errors or something even more.

            Mach 10, 2004
            Originally posted by Steve Machol
            Well doing this will require a lot of work. Userids (like postids, threadids, forumids, etc.) are incremented. It would take a major rewrite of the software to change this.
            I think a completely fresh installation will clean out your database.

            Comment

            • cbiweb
              Senior Member
              • Apr 2004
              • 2658
              • 4.1.x

              #7
              Out of the question for this particular forum I'm working on. It has been extensively hacked, including the addition of new tables in the database. I'm not gonna rebuild all that.

              I'll deal with it the best way I can. Thanks for your help.
              ~ Life isn't always fair, but you can be. ~

              Comment

              • Lats
                Senior Member
                • Mar 2002
                • 3671

                #8
                Originally posted by cbiweb
                ...but not the newest member link.
                That info is stored in the datastore table as a serialized string and looks something like this...
                Code:
                a:3:{s:13:"numbermembers";s:4:"2137";s:11:"newusername";s:8:"cbiweb";s:9:"newuserid";s:4:"2145";}
                If this was your data, you would need to change this part...
                "newuserid";s:4:"2145"; to this...
                "newuserid";s:1:"2";
                Lats...

                Comment

                • cbiweb
                  Senior Member
                  • Apr 2004
                  • 2658
                  • 4.1.x

                  #9
                  Hey, thanks Lats! When I get back to working on the site I'll try that.
                  ~ Life isn't always fair, but you can be. ~

                  Comment

                  widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                  Working...
                  😀
                  😂
                  🥰
                  😘
                  🤢
                  😎
                  😞
                  😡
                  👍
                  👎