我收到此错误:
“警告:mysqli_num_rows()要求参数1为mysqli_result,在(...)中给出布尔值”
并且不知道为什么......
这是我的代码:
(...)
$queryUser = "SELECT e_mail, tlm, p_nome, l_nome FROM USER WHERE e_mail= ".$e_mail." OR tlm= ".$tlm.";";
$result= mysqli_query($conn,$queryUser);
if (!$result || mysqli_num_rows($result) == 0){
$checkUser = mysqli_num_rows($result);
}
if($checkUser>0){
$error= 'Utilizador já existe!';
}else {
if($pass == $pass2){
$pass=md5($pass);
try{
$queryreg2= mysqli_query($conn,"INSERT INTO USER (id_user, e_mail, pass, p_nome, l_nome, tlm, admin, prof, ser, caminho,x,y,h,alt,xpos,ypos) VALUES('',".$e_mail.",".$pass.", ".$p_nome.", ".$l_nome.", ".$tlm.", '0','0','0','','0','0','0','','0','0');");
$queryIDUser = "SELECT id_user FROM USER WHERE e_mail= ".$e_mail." OR tlm= ".$tlm." AND p_nome= ".$p_nome." AND l_nome=".$l_nome.";";
$result2= mysqli_query($conn,$queryIDUser);
if (!$result2 || mysqli_num_rows($result2) == 0){
$get_id = mysqli_num_rows($result2);
if($get_id==1){
while($row = mysqli_fetch_array($result2)){
$id_user=$row['id_user'];
}
(...)
感谢您阅读我的SOS消息:)