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 MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

get autoincrement key after MySQL insert 1

Status
Not open for further replies.

RobBroekhuis

Technical User
Oct 15, 2001
1,971
US
When I insert a new record into a MySQL table using a call like
$result=mysql_query("insert into....",$db);

is there any way to get the key (auto-increment) that MySQL assigns to the new record from the $result, or do I have to execute another query to find that one out?


Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top