I have a query and i want to get the last ID had inserted , the filed ID is primary key and auto increment
i know that i have to use this statement
LAST_INSERT_ID()
That statement works with me when the query like this
$query = "INSERT INTO `cell-place` (ID) VALUES (LAST_INSERT_ID())";
But if i want to get that ID using this statement
$ID = LAST_INSERT_ID();
I have got this error
Fatal error: Call to undefined function LAST_INSERT_ID()
What am i doing wrong please
No comments:
Post a Comment