Jump to content
Larry Ullman's Book Forums

Logi error


Recommended Posts

Hello, i maded login page, but when i try to login, it say "Login Failed, Invalid Input!". In error_log: "PHP Warning:  mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in /home2/minerdog/public_html/ChatPhp/login.php on line 27". my code: "

		if(mysqli_num_rows($query)==0){
			$_SESSION['msg'] = "Login Failed, Invalid Input!";
			header('location: index.php');
		}

" Help me :(

Link to comment
Share on other sites

So this means your query isn't returning 0 rows. The likely causes are:

  • The provided login details are actually incorrect.
  • The provided details are correct but there's a mismatch in your comparison algorithm (e.g., the encrypted password is stored one way but the match is checked in another way).
  • Neither of the above is true but you have a syntax error with your query.

 

Link to comment
Share on other sites

 Share

×
×
  • Create New...