检查局部变量是否等于局部变量的正确方法
Correct way to check if local variable equals local variable
这不会计算,即使值应该相等,它会直接进入 else 事件。 table 列名与数据库匹配,所以...
我需要在 ($recruitcheck==$recruitpass) 中使用某种类型的引号吗?
$recruiter = $_POST["recruiter"];
$recruitpass = $_POST["recruitpass"];
$recruitcheck = mysqli_query($maindb, "select aurapass from auras where auraname='$recruiter'");
if($recruitcheck == $recruitpass) {
$badgecheck = mysqli_query($maindb, "select recruitbadge from auras where auraname='$recruiter'");
if($badgecheck == "0") {
echo "<script>alert('Recruiter information correct, but there is no recruit badge.')</script>";
exit();
} else {
echo "<script>alert('Recruiter badge accepted.')</script>";
$emailcheck = mysqli_query($maindb, "select * from auras where email='$email'");
$namecheck = mysqli_query($maindb, "select * from auras where auraname='$auraname'");
if(mysqli_num_rows($emailcheck) > 0 || mysqli_num_rows($namecheck) > 0){
echo "<script>alert('New auraname/email is already taken.')</script>";
exit();
} else {
exit();
}
}
} else {
echo "<script>alert('Aura information of recruiter is incorrect. Please, use preexisting aura information to confirm recruiter identity.')</script>";
exit();
}
$recruitpass 是一个字符串,而 $recruitcheck 是 mysqli_result 对象。在将其与 $recruitpass
进行比较之前,您需要获取对象 inside 中的字符串值
这不会计算,即使值应该相等,它会直接进入 else 事件。 table 列名与数据库匹配,所以...
我需要在 ($recruitcheck==$recruitpass) 中使用某种类型的引号吗?
$recruiter = $_POST["recruiter"];
$recruitpass = $_POST["recruitpass"];
$recruitcheck = mysqli_query($maindb, "select aurapass from auras where auraname='$recruiter'");
if($recruitcheck == $recruitpass) {
$badgecheck = mysqli_query($maindb, "select recruitbadge from auras where auraname='$recruiter'");
if($badgecheck == "0") {
echo "<script>alert('Recruiter information correct, but there is no recruit badge.')</script>";
exit();
} else {
echo "<script>alert('Recruiter badge accepted.')</script>";
$emailcheck = mysqli_query($maindb, "select * from auras where email='$email'");
$namecheck = mysqli_query($maindb, "select * from auras where auraname='$auraname'");
if(mysqli_num_rows($emailcheck) > 0 || mysqli_num_rows($namecheck) > 0){
echo "<script>alert('New auraname/email is already taken.')</script>";
exit();
} else {
exit();
}
}
} else {
echo "<script>alert('Aura information of recruiter is incorrect. Please, use preexisting aura information to confirm recruiter identity.')</script>";
exit();
}
$recruitpass 是一个字符串,而 $recruitcheck 是 mysqli_result 对象。在将其与 $recruitpass
进行比较之前,您需要获取对象 inside 中的字符串值