I have the following code and I would like to know if mysqli_query
returned any rows and if so return an error.
$result = mysqli_query($connection, "SELECT * FROM users");
if ($result == "") {
echo "No records found";
} else {
echo "There is at least one record in the database";
}
I'm having trouble if the results come back as empty. I've tried using several things and can't figure out how to get it work correctly if nothing is found.