我创建了一个注册页面,一切正常。只是想让这个小插入返回 id(设置为自动增量)。我该怎么做呢?
$sql = "INSERT INTO accounts (street1, suburb, city, postcode, username) VALUES(?, ?, ?, ?, ?)";
if (! $accres = $connection->prepare($sql)){
$userinfo = "<font color = red>Account preparation failed: (" . $connection->errno . ") " . $connection->error . "</font>";
showRegisterForm ( $userinfo );
} else {
$accres->bind_param("sssss", $address, $suburb, $city, $postcode, $username);
$accres->execute();
}