Uncaught TypeError: mysqli_num_rows(): Argument #1 ($result) must be of type mysqli_result, bool (error in this line $num=mysqli_num_rows($queryfire);

Viewed 13
$sql="SELECT * FROM phptrip WHERE destination=`Netherland`";
$queryfire  = mysqli_query($con,$sql);
var_dump($queryfire );
//find the number of records returned;
if(!$queryfire  || mysqli_num_rows($queryfire) == 0){
   **$num = mysqli_num_rows($queryfire); //getting error in this line**
}
echo "<br> Total number of records found in the database is ".$num." !!!<br>";
?>
}

I AM GETTING ERROR IN THIS LINE **$num = mysqli_num_rows($queryfire); **

0 Answers
Related