<?php
// Connect to the database.
$query = "select max(id) from testTable limit 0, 100";
$result = mysql_query($query) or die("Error when incrementing.");
while(list($id) = mysql_fetch_row($result))
{
print("Current id is: $id");
$id++;
print("The next id is: $id");
}
// Close the database connection.
?>
I use this all the time. I haven't gotten around to trying a better "condition" statement. I think if "limit 0, 100" were to be replaced by "where sign(id) = 1", it would work equally if not better than limiting the amount of rows in your database to 100. I haven't tried that out yet though.
Just reply back here if there are any problems.