Example: I insert a row into the DB with this, using PHP\'s built in PDO:
$sql = \"INSERT INTO mytable (name, ok) VALUES (\'john\', \'1\')\"; $this->dbh-&
If the id is an auto_increment, you can use PDO::lastInsertId :
id
auto_increment
Returns the ID of the last inserted row, or the last value from a sequence object, depending on the underlying driver.
So, in your case, something like this should do the trick :
$lastId = $this->dbh->lastInsertId();