I am running an insert query using PDO and then getting the newly created Id with lastInsertId(). This is all working on my localhost environment.
When I move the exact same code onto a server, the lastInsertId() is always returning blank, even though the insert statement works and inserts the new row into the database. Would this be a setting in my configuration? Any help is appreciated.
$insertstmt = $dbinsert->prepare($insertsql);
// bindParams ...
$insertstmt->execute();
// always blank
$id = $dbinsert->lastInsertId();
$dbinsert = null;