php - How to get last created ID -
no matter try - cant seem pull last created id of query inserted mysql.
i read here syntaxes deprecated , sort of code wont work.
i tried both functions (i use bigint) understand how go:
if (($result = $conn->query("select last_insert_id()")) === false) { die(mysql_error()); } if ($result->fetch_assoc()) { $id = $row[0]; echo $id; }
but nothing!!
can please give me full simple php code sample of how it?
you can use $result = $conn->insert_id; know last inserted row
Comments
Post a Comment