Canman2005 Posted March 11, 2006 Share Posted March 11, 2006 Dear allI have a php insert query to insert some form data. Once the form has been submitted and the data added to the sql database, is there anyway to bring the auto increase ID number which is generated in the sql database?Any help would be great.ThanksEd Quote Link to comment Share on other sites More sharing options...
AndyB Posted March 11, 2006 Share Posted March 11, 2006 [a href=\"http://ca.php.net/manual/en/function.mysql-insert-id.php\" target=\"_blank\"]http://ca.php.net/manual/en/function.mysql-insert-id.php[/a] will retrieve the last autoincrement ID Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted March 11, 2006 Author Share Posted March 11, 2006 HiThat worked great, thanks.Can the value be passed to another page via a session? How would that be done? Tried few things without any luck.Thanks in advanceEd Quote Link to comment Share on other sites More sharing options...
Canman2005 Posted March 11, 2006 Author Share Posted March 11, 2006 Worked it out, if anyone is interested I passed$_SESSION['nextid'] = mysql_insert_id();with my php page action and then called the session name ($_SESSION['nextid']) on the next page.Thanks anyone who helpedEd Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.