Get last inserted record ID PHP-MySQL

This function gets last inserted records ID

function select_max_id($id="id",$my_table="cms_pages")
{
$db = new clsDBcms();//You may have different connection class

$SQL = "SELECT MAX($id) FROM ".$my_table;
$db->query($SQL);
if ($db->next_record())
{
$max_id = $db->f(0);
}
$db->close();
return $max_id;
}

Misc Links, Resources

Upperhost best web hosting

Hobby Projects

Under development:
feedpixel.com - Feeding Your Pixels :-)
Sexy URL!
TAXI CMS Booking System
WebShop, Project Manager, Support System.

Recommended

Link Partners

Web Design Forum