search table database for unique id

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
JonathanStanton
Forum Newbie
Posts: 10
Joined: Wed Jul 21, 2010 10:07 am

search table database for unique id

Post by JonathanStanton »

Alright so this is a multi -step process:

(1) User creates new Real Estate Listing by filling out a form (Add.php)
(2) User submits Listing to database table 'listing' and Advances to next page (upload.php)
(3) User uploads images which are stored in 'upload_images' table which is linked to 'listing' table via targeting the listings unique id.
-----
Question: When I advance to my next page what's the best way to get unique_id of the listing I just posted?
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

Re: search table database for unique id

Post by cpetercarter »

Have a look at mysql_insert_id().
Post Reply