Jhunter Posted February 26, 2011 Share Posted February 26, 2011 when player register to my game the user id's are starting at 220+ instead of following the previous id. for example i am id 1 then the next player is id 220, instead of being id 2 .. Any ideas?? Quote Link to comment Share on other sites More sharing options...
Blade Maker Posted February 26, 2011 Share Posted February 26, 2011 Well first make sure its set to auto increment, second if that doesnt work, delete the ID row and then make it again and it should all be in order. Also make sure that the php that inserts to the database that the ID is '' so its empty. Quote Link to comment Share on other sites More sharing options...
bluegman991 Posted February 26, 2011 Share Posted February 26, 2011 causes of this problem will be either creating a row with the id being set to a custom value rather than being left blank. after the row was created the new auto increment value was set to that row id +1 or at one time user id 1-200 existed or still does exist (Tip deleting rows at the end of the table will not set the auto increment value to the last/highest id.) (Tip when inserting new rows mysql will not automatically fill in missing rows. You will have to do this yourself... If you want it done.) first be sure you have the id field set as an auto increment after you have confirmed that the field is auto increment you can go into phpmyadmin > yourtable > edit: id field from there you can edit the auto increment value whatever value it is on will be the id of the next row created Quote Link to comment Share on other sites More sharing options...
Jhunter Posted February 26, 2011 Author Share Posted February 26, 2011 i have checked that it is set to auto increment in my database, but oddly when i used a new database and tried a few test registrations it worked perfectly fine, so its not a issue with my files and the database is correct Quote Link to comment Share on other sites More sharing options...
Djkanna Posted February 26, 2011 Share Posted February 26, 2011 Happen to have deleted a few users? When deleting users, make sure to turn back where your database increments from via PHPMyAdmin -> Users table -> Operations -> Look for "AUTO INCREMENT" under 'Table Options' @screen: http://prntscr.com/1l9j1 Quote Link to comment Share on other sites More sharing options...
Danny696 Posted February 26, 2011 Share Posted February 26, 2011 Well first make sure its set to auto increment, second if that doesnt work, delete the ID row and then make it again and it should all be in order. WOW, i mean just WOW. That would fuck their game up even more. It wouldnt match any other table. So ID 37 could have ID 57's stats.... Also make sure that the php that inserts to the database that the ID is '' so its empty. WOW again, with your extensive knowlage, you shouldnt be here, you should just be on your own sup3r forum.... PHP doesnt insert anything anywhere. Its the MySQL, in this case anyway, But i though you would have known that ugh.. And what happens if i insert the ID as NULL? Quote Link to comment Share on other sites More sharing options...
Jhunter Posted February 26, 2011 Author Share Posted February 26, 2011 Thanks Djkanna your knowledge has helped me out and i have solved the problem Quote Link to comment Share on other sites More sharing options...
Djkanna Posted February 26, 2011 Share Posted February 26, 2011 No problem. :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.