Inserted ID

Hi All,
So I know I can generally do

$result = mysql_query($qry);
$id=mysql_insert_id(); 

What I’m wondering since I prefer to use the OOP version of mysqli is how do I do the same thing except with:

$result = $db->query($qry);
$id=$result->insert_id(): //?? Maybe??

Thanks so much in advance!

I believe it is:

$result = $db->query($qry);
$id = $db->insert_id;

off topic: pdo is better :wink:

I have never used PDO and right now I’d rather get a better handle on OOP/MCV style of development than learn a different database system.

but thank you that works! apparently the initial object, not the result object… damn dirty apes!