...

View Full Version : Retrieve Auto incrimented field?



jedimastermopar
11-21-2006, 02: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.

marek_mar
11-21-2006, 02: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.

jedimastermopar
11-21-2006, 03: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. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum