find primary key of post

Reply

Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

find primary key of post

 
0
  #1
Jan 9th, 2007
Hey everyone, I wasn't sure if this should go in the php section or this one, so hopefully this is right, if not, move it for me.

I have a form that a user fills out, it posts the information to a MySQL database, and then spits out the information they submitted to the screen, so they can verify it is correct.

I would like to provide a link underneath the information for them to change some of it in case they provided bad info. But I don't know how to get the primary key value yet, because it was just submitted, and I don't have anything to reference it with yet.

The field that is the primary key is called "ID". So how do I get the ID number right after the post, when I don't have anything to reference it to?
Reply With Quote Quick reply to this message  
Join Date: Aug 2006
Posts: 138
Reputation: php_daemon is an unknown quantity at this point 
Solved Threads: 2
php_daemon php_daemon is offline Offline
Junior Poster

Re: find primary key of post

 
0
  #2
Jan 9th, 2007
mysql_insert_id() in php

or
last_insert_id() in mysql
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: find primary key of post

 
0
  #3
Jan 9th, 2007
Originally Posted by php_daemon View Post
mysql_insert_id() in php

or
last_insert_id() in mysql
Thanks, i'll give that a try.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: find primary key of post

 
0
  #4
Jan 10th, 2007
works perfect by the way. Thanks!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC