There is an example near the end of the documentation for last_insert_id. Something like this I am guessing.
$sql = "
UPDATE $table SET item=?, id=LAST_INSERT_ID(id)
WHERE
id<10
ORDER BY
id ASC
LIMIT 1;
";
//and then
$last_id = mysqli_insert_id($conn);
echo "Last inserted ID is: " . $last_id;
We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.