Capture auto_increment number

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Capture auto_increment number

Post by abshaw »

I have a php code inserting into a mysql database, the table has a primary key which is auto_increment.

Now when a new record is being added it is not know what id will be assigned to the record as it depends when the form is submitted.

but once the form is submitted i want to capture the id assiged to the current record and then display

<? php
echo "Thankyou, Information on file number $f_id has been successfully added."

?>

any sugesstions?
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

abshaw
Forum Commoner
Posts: 33
Joined: Thu Feb 19, 2004 7:14 pm

Post by abshaw »

great, works like a charm.
Post Reply