How can I get the insert_id of the last record using mysqli prepare statement, for example following?
$stmt = $this->mysqli->prepare("INSERT INTO test (name) values (?)")
$stmt->bind_param('s', $name);
$stmt->execute();
How can I get the insert_id of the last record using mysqli prepare statement, for example following?
$stmt = $this->mysqli->prepare("INSERT INTO test (name) values (?)")
$stmt->bind_param('s', $name);
$stmt->execute();
$new_id = $this->mysqli->insert_id;
(after $stmt->execute()
)
© 2022 - 2024 — McMap. All rights reserved.