sungpeng Posted April 9, 2009 Share Posted April 9, 2009 mysql set auto-increment keep on running up.. 80, 81, 82, 83.. like say I need it to start running from specific number like start running from 20, 21 ,22, 23 how should I command? Quote Link to comment Share on other sites More sharing options...
revraz Posted April 9, 2009 Share Posted April 9, 2009 If you have access to phpmyadmin, you can set it there. Quote Link to comment Share on other sites More sharing options...
sungpeng Posted April 9, 2009 Author Share Posted April 9, 2009 ya revraz, I do access phpmyadmin, but which button and where? I delete 79,80,81,82, the number still run from 83. It does not go back to 79. Quote Link to comment Share on other sites More sharing options...
sungpeng Posted April 9, 2009 Author Share Posted April 9, 2009 and can tip me if 75, 76, 78 ,79 is occupied, I want the new entry to insert into 77 empty row, is it possible from php. If like that increment, it can go up to 10000. Quote Link to comment Share on other sites More sharing options...
Mark Baker Posted April 9, 2009 Share Posted April 9, 2009 and can tip me if 75, 76, 78 ,79 is occupied, I want the new entry to insert into 77 empty row, is it possible from php. If like that increment, it can go up to 10000. Autoincrement does not work in this way, it doesn't look for the gaps, but simply adds 1 to the last value it used... if a record with that key already exists (it shouldn't if you're using it properly) then you'll get an error on insert. But it shouldn't be necessary to have a set of IDs without any gaps, so why are you so worried about this Quote Link to comment Share on other sites More sharing options...
revraz Posted April 9, 2009 Share Posted April 9, 2009 ALTER TABLE tablename AUTO_INCREMENT=1234 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.