Jump to content
Larry Ullman's Book Forums

Recommended Posts

I'm getting an error that says parameter 1 of mysqli_num_rows($r) should be a mysqli_result, Boolean given. Here is the applicable code:

 

$q = "SELECT email, username FROM users WHERE email='$e' OR username='$u'";

$r = mysqli_query($dbc,$q);

$rows = mysqli_num_rows($r); //This is where the error occurs.

 

Help would greatly be appreciated! Thank you.

Link to comment
Share on other sites

That means your query is failing and it's returning a Boolean--almost certainly false--instead of a result set. You should check the value of $r before trying to use it in mysqli_num_rows() and use error reporting accordingly to debug this.

Link to comment
Share on other sites

 Share

×
×
  • Create New...