I'm not sure if my title is even worded correctly. Hopefully I can explain this in a concise manner. I'm trying to select all from a database:
if (! empty ( $fname ) && ! empty ( $lname )) {
$query5 = "select * from " . $db_prefix . "customer_det where (fname = '" . $fname . "' and lname = '" . $lname . "')";
$result5 = $mysqli->query ( $query5 ) or die ( mysql_error () );
} else {
$query5 = "select * from " . $db_prefix . "customer_det where phone = '" . $phone . "'";
$result5 = $mysqli->query ( $query5 ) or die ( mysql_error () );
}
Then my next statement basically says if $result5 === NULL then insert stuff. Problem is I'm var_dump($result5) and it looks like it's printing out an array.
object(mysqli_result)#4 (5) { ["current_field"]=> int(0) ["field_count"]=> int(34) ["lengths"]=> NULL ["num_rows"]=> int(0) ["type"]=> int(0) }
Basically what I'm trying to say is how can I write an IF $result5 = non existent statement. Is it a count or num_rows function im looking for here?