Quick Search:
 PHP Code: Get last added insert ID Jump to:  
Category: >> PHP Code >> Get last added insert ID  

<< lastnext >>

Snippet Name: Get last added insert ID

Description: Get the id of an auto_incrementing id from a mySQL insert.

Comment: (none)

Language: PHP
Highlight Mode: PHP
Last Modified: March 01st, 2009

// Do your insert query...
mysql_query("INSERT etc...");
// This finds the id of the row once it has been added...
$id = mysql_insert_id();
// Display it...
ECHO $id;

   Home |    Search |    Code Library |    Sponsors |    Privacy |    Terms of Use |    Contact Us © 2003 - 2024 psoug.org