Hello all.<br /><br />I would like to know if there is a way to get the auto increment number from a row that is just created.<br /><br />Here's the senario:<br /><br />I'm using PHP to display a page and have the user input some information.<br />Then I have the PHP code 'INSERT' that data into a new row that is created dynamically.<br />Each row that is created is given a unique id number by auto increment. The number is placed into the field 'id'.<br />What I want to get is after the information is inputted into the database, have the newly created "id number" returned so I can have the page show the inputted data.<br />Do you understand my question, or did I ramble? Anyway, if you do understand and can help, I sure would appreciate it.<br /><br />Thank you.<!--content-->
You can get the last AUTO_INCREMENT generated by using the <a href="http://www.php.net/manual/en/function.mysql-insert-id.php" target="_blank">mysql_insert_id()</a> function right after performing the INSERT query.<!--content-->
You can get the last AUTO_INCREMENT generated by using the <a href="http://www.php.net/manual/en/function.mysql-insert-id.php" target="_blank">mysql_insert_id()</a> function right after performing the INSERT query.<!--content-->