Jump to content

mm how do i get the value of the last id?


shadiadiph

Recommended Posts

Well, personally, i would just use the command that is already built into the application: mysql_insert_id()

 

http://us.php.net/mysql_insert_id

 

mysql_insert_id

 

mysql_insert_id — Get the ID generated from the previous INSERT operation

 

 

OR, if you need to use it in a query:

$query = "UPDATE table SET foo = 'bar' WHERE id = LAST_INSERT_ID()";

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.