Answer by andrewsi for How to get last inserted inserted row id from PDO
You're almost there. If you look at the manual page for lastInsertId, it's called on the database handle - you're currently calling it on the statement. You just need to call:...
View ArticleAnswer by Mithun Sen for How to get last inserted inserted row id from PDO
you can try the following - $query = "INSERT INTO song (artist, track, link) VALUES (:artist, :track, :link)"; $stmt = $pdo->prepare($query); $params = array( "artist" => $artist, "track" =>...
View ArticleHow to get last inserted inserted row id from PDO
I am following mvc structure in PHP and I want to retrieve last inserted row ID. I have created following sql code: $sql = "INSERT INTO song (artist, track, link) VALUES (:artist, :track, :link)";...
View Article
More Pages to Explore .....