I am using the PHP function mysqli_query
to run a SELECT
query.
What does mysqli_query
return if the query runs successfully, but
if ($result = $mysqli->query("SELECT * FROM data"))
{
$count = $result->num_rows;
printf("Result set has %d rows.\n", $count);
$result->close();
}
From reference:
Returns FALSE on failure. For successful SELECT, SHOW, DESCRIBE or EXPLAIN queries mysqli_query() will return a mysqli_result object. For other successful queries mysqli_query() will return TRUE.