Rather than query repeatedly, you could do this in one query (reading many rows). The following is a PHP function - so it should be easy to convert it to any other language:
function db_next_int($table, $id)
{
$result = mysql_query("select $id
from $table
order by $id")...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.