So I am using PDO statements and I have a very handy command
$db->lastInsertId();
which is helping me track the last inserted record’s id. I checked but did not find clear answers if there is a handy function like that. It would be cubersome to run a whole query to get that, as it is being mentioned in some pages.
How to get the last updated record?
How to get exactly the id of the last inserted record in mysql?
Thanks.
I think
mysql_insert_id()is what you are looking for.You can find more info on the function here http://php.net/manual/en/function.mysql-insert-id.php