View Single Post
Old 12-15-2007, 03:21 PM   #2 (permalink)
exam
Contributing Member
 
exam's Avatar
 
Join Date: 04-20-06
Posts: 333
iTrader: 0 / 0%
Latest Blog:
None

exam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web proexam is a highly respected web pro
Run these queries:

Code:
SELECT MAX(`id`) FROM `tablename`; //$number gets the result of the first query plus 1. ALTER TABLE `tablename` AUTO_INCREMENT = $number;
But you haven't done a good job describing your problem. What you really should do, is in your code to create a new row, have it check the table to see if there are any unused ids, and give the new row that id instead of the auto increment value.
exam is offline   Reply With Quote