Codeigniter Menu

HTML CSS

Video

Sound

SEO


May 12
2011

MYSQL Last Inserted ID

Posted by bohemia in Untagged 

While creating or upgrading a php script, there is often a time when you want to find the last inserted id with mysql. The purpose is to get that id from the database and make it a variable for another database query.

The code to acquire the last inserted id of an auto_incremented id in a database table is to call the function:

$get_my_last_id = mysql_insert_id($dbc);
Comments (0)add comment

Write comment

busy