I am using the PHP function mysqli_query to run a SELECT query.
What does mysqli_query return if the query runs successfully, but the query finds no matches?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Per the manual:
A query that runs but returns no results is still considered a “successful query”, since the query did run in the database and an empty result set is a legitimate response. This means the query will still return a
mysqli_resultobject, and if you check its row count (either via$result->num_rowsin the object-oriented style ormysqli_num_rows($result)in the procedural style) it will return 0.