Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何使用 mysqli prepare 语句获取最后一条记录的 insert_id,例如以下?
$stmt = $this->mysqli->prepare("INSERT INTO test (name) values (?)") $stmt->bind_param('s', $name); $stmt->execute();
$new_id = $this->mysqli->insert_id;(之后$stmt->execute())
$new_id = $this->mysqli->insert_id;
$stmt->execute()
mysqli->insert_id