php - mysqli_num_rows() boolean error -
while running code, shows error mysqli_num_rows() expects parameter 1 mysqli_result, boolean
please me find solution:
if(!empty($email_id) && !empty($password)){ $query="select 'email_id' 'user_details' 'email_id'='$email_id' , 'password'= '$password'"; $con=mysqli_connect("localhost", "root", "","idukki"); $query_run = mysqli_query($con,$query); $query_num_rows = mysqli_num_rows($query_run); if($query_num_rows == 0) { echo'invalid email , password combination'; } else if($query_num_rows == 1) { $user_id = mysqli_result($query_run,0,'email_id'); } }
when type of error regarding mysql first thing should print out sql , test in phpmyadmin, if passes in phpmyadmin have error in script, if not bad sql
Comments
Post a Comment