我已经写了这样的代码:
$password = md5($password);
mysql_query("INSERT INTO `users` (username,password,email,pnum,hintque,hintans) VALUES('$username','$password','$email','$cnum','$hintque','$hintans')");
mysql_query("INSERT INTO `personal` (userid,fname,lname,address,dob,country,state,city,poscode) VALUES(LAST_INSERT_ID(),'$fname','$lname','$address','$dob','$country','$state','$city'.'$zip')");
header("location: ../register.php?feedback=Registration Complete. You May Now Login");
但只有第一个 sql 成功插入数据。第二个失败。我希望两个查询同时触发。