Question: pdo how to get last inserted id?
Answer: You can use PDO::lastInsertId() . lastInsertId() only work after the INSERT query. You can get the id of the last transaction by running lastInsertId() method on the connection object($conn).