returning next autoindex id
Posted: Sat Apr 19, 2003 2:49 pm
i've found a PHP function (mysql_insert_id) that will tell you the autoincrement value used by the current query, but can't figure out how to determine the last used auto_increment key if i haven't made a query.
i just want to query a table and determine what the next key will be so i can auto populate a form.
this just returns (0 + 1) so it's not really helpful. does anyone know how to query the table for the last used auto_increment key?
thanks in advance
i just want to query a table and determine what the next key will be so i can auto populate a form.
Code: Select all
$next_autoindex_id = mysql_insert_id();
echo ($next_autoindex_id + 1);thanks in advance