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.