Dear Friends. I want to get the How to get the Next Auto Increment number in Mysql using PHP code ? can i get the Next Auto Increment number in Mysql Usiing PHP code?? Please help me
$r = mysql_query("SHOW TABLE STATUS LIKE 'table_name' "); $row = mysql_fetch_array($r); $Auto_increment = $row['Auto_increment']; mysql_free_result($r); PHP:
If you just inserted a row, you may use mysql_insert_id which basically gets the id generated from the previous insert. mysql_query("INSERT INTO mytable (id,product) values ('','item')"); $iLastID = mysql_insert_id(); PHP: Marc