943,973 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Unsolved
  • Views: 3623
  • MySQL RSS
Jan 9th, 2007
0

find primary key of post

Expand Post »
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?
Similar Threads
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005
Jan 9th, 2007
0

Re: find primary key of post

mysql_insert_id() in php

or
last_insert_id() in mysql
Reputation Points: 13
Solved Threads: 2
Junior Poster
php_daemon is offline Offline
138 posts
since Aug 2006
Jan 9th, 2007
0

Re: find primary key of post

Click to Expand / Collapse  Quote originally posted by php_daemon ...
mysql_insert_id() in php

or
last_insert_id() in mysql
Thanks, i'll give that a try.
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005
Jan 10th, 2007
0

Re: find primary key of post

works perfect by the way. Thanks!
Reputation Points: 10
Solved Threads: 0
Posting Whiz in Training
nathanpacker is offline Offline
234 posts
since May 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Using Databases
Next Thread in MySQL Forum Timeline: online tutorial





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC