This is my form:
One needs to test to see if $r is true, and if row count is greater than 0.
$r
The following works:
if ($r and mysqli_num_rows($r) > 0) { echo "rows exist"; } else { echo "rows don't exist"; }