View Full Version : Retrieve Auto incrimented field?
11-21-2006, 01:40 PM
I have a page where the user inputs a number of field data. The I use some php to make some calculations and upload the results and inputed data into a table. I want to then display the calculated results and the user input and the primary key(that is set to auto incriment). How would I go about doing this to make sure that I return back the right number to match the record that was just created.
11-21-2006, 01:53 PM
mysql_insert_id() (http://www.php.net/manual/en/function.mysql-insert-id.php) if you're using MySQL with the mysql extension.
11-21-2006, 02:16 PM
Ahhh Sweeet. Thanks. I am a converted VB/C+ coder and the more and more php I use the more and more I like it. :)
Powered by vBulletin® Version 4.2.2 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.