Quantcast
Channel: How to get last inserted inserted row id from PDO - Stack Overflow
Browsing latest articles
Browse All 3 View Live

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 Article



Answer 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 Article

How 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
Browsing latest articles
Browse All 3 View Live




Latest Images