I'm getting an error message: Call to undefined method PDO::last_Insert_Id()
Here's my code:
$testcode = $conn -> prepare("INSERT INTO tblCategory
(Category, DisplayOrder)
VALUES('Test', 0)");
try {
$testcode ->execute();
$ID = $conn->last_Insert_Id();
}
catch (PDOException $e)
{echo $e->getMessage();
}
var_dump($conn instance of PDO) returns bool(true) so $conn is the PDO connection.
How do I correct so I don't get the error? I do need that last inserted id. Thanks.