mysqli_query()
returnerer FALSE
hvis der var en fejl i forespørgslen. Så du bør teste for det...
/* Select queries return a resultset */
if ($result = mysqli_query($dbc, "SELECT Name FROM City LIMIT 10")) {
printf("Select returned %d rows.\n", $result->num_rows);
/* free result set */
$result->close();
}
Se dette link for mysqli_query
referencehttp://php.net/manual/en/mysqli.query.php