robert1962 Posted June 8, 2015 Share Posted June 8, 2015 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 More sharing options...
Larry Posted June 8, 2015 Share Posted June 8, 2015 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 More sharing options...
robert1962 Posted June 9, 2015 Author Share Posted June 9, 2015 Thanks for the insight. Yes...there was an error in the code in $q, I accidently placed a single quote before username in the query which I didn't in the question I sent to you. Thanks very much. Link to comment Share on other sites More sharing options...
Recommended Posts