get last inserted id in pdo php code example
Example 1: php pdo last insert id
$stmt = $db->prepare("...");
$stmt->execute();
$id = $db->lastInsertId();
Example 2: get last inserted id in php
Example (MySQLi Procedural)
$last_id = mysqli_insert_id($conn);
Example 3: get last insert id pdo
$(document).ready(function(){
$.ajax({ url: "database/update.html",
context: document.body,
success: function(){
alert("done");
}});
});