所以,我得到了这个错误: mysqli_num_rows()期望参数1为mysqli_result
我的代码:
if(isset($_GET["email_pw"])) {
if($_GET["email_pw"]==$configs["email"]){
$smarty->assign('message', 'Hoće li to majstore :)');
} else {
$email_pw = stripslashes($_GET["email_pw"]);
$email_pw = mysqli_real_escape_string($connect, $email_pw);
$pw = mysqli_query($connect, 'SELECT * FROM clients WHERE email="'.$email_pw.'"');
$pw2 = mysqli_num_rows($pw); // ERROR LINE!!!!!!!!!!
if($pw2==1) {
function generatePassword($length=9, $strength=0) {
$vowels = 'aeuy';
$consonants = 'bdghjmnpqrstvz';
if ($strength & 1) {
$consonants .= 'BDGHJLMNPQRSTVWXZ';
}
if ($strength & 2) {
$vowels .= "AEUY";
}
if ($strength & 4) {
$consonants .= '23456789';
}
if ($strength & 8) {
$consonants .= '@#$%';
}
错误行是这样的: $ pw2 = mysqli_num_rows($ pw);