Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP with MySQL

Status
Not open for further replies.
Feb 9, 2001
10
US
I'm coding with PHP and I'm doing a query using mysql_query(), a previous coder put a line of code in that calls the mysql_insert_id function and stores the value in a variable.
this is how it looks: $insertid = mysql_insert_id(); My question is doesn't it have to have the name of the query, so it knows which one to pull the id from?

Any help would be greatly appreciated.
Thanks:)
 
from php.net

"mysql_insert_id() returns the ID generated for an AUTO_INCREMENT column by the previous INSERT query using the given link_identifier. If link_identifier isn't specified, the last opened link is assumed."

hope that'll answer your question
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top