请帮助我。我进行了搜索,但是正在使用PDO和过程($stmt-> fetch()
)。我不明白
$sqls="SELECT ul.ul_uid,ul.ul_uname ,ul.ul_email,ul.ul_usertype,u.u_fname,u.u_lname FROM tbl_userlogin AS ul INNER JOIN tbl_user AS u ON u.u_id=ul.ul_uid WHERE ul.ul_uname=? OR ul.ul_email=?";
$stmt=mysqli_stmt_init($conn);
if(!mysqli_stmt_prepare($stmt,$sqls)){
header("location:/signup.php?err=sqlError001");
exit();
} else {
mysqli_stmt_bind_param($stmt,"ss",$uname,$email);
mysqli_stmt_execute($stmt);
mysqli_stmt_store_result($stmt);
$result=mysqli_stmt_get_result($stmt);
$count= mysqli_stmt_num_rows($stmt);
} if($count>0) {
$result=mysqli_stmt_fetch($stmt);
if($result['ul_email']==$email)
{
header("location:../signup.php?err=Email Exist");
exit();
}
else if($result['ul_uname']==$uname)
{
header("location:../signup.php?err=username taken");
exit();
}
}
查询有效。我也尝试了绑定结果,没有用。也欢迎您提出绑定结果。