mysqli number of row always giving me an error
<p>Hi I was doing a check if the fetch array will give me 0 rows of data so I use the num_row()
but i always give me an error</p>

<pre><code>Warning: mysqli_num_rows() expects parameter 1 to be mysqli_result, boolean given in C:\xampp\htdocs\PostImages\displayImages.php on line 8
</code></pre>

<p>HERE is my code that I used</p>

<pre><code>&lt;?php
$con = mysqli_connect('127.0.0.1', 'root', '', 'test');

$id = mysqli_real_escape_string($con,$_REQUEST['id']);
$query = "SELECT image_posts FROM ratepicture WHERE id = ".$id."";
$image = mysqli_query($con, $query);

if(mysqli_num_rows($image) == 0)
{
$queryError = "SELECT image FROM error_pictures WHERE id = 1";
$error = mysqli_query($con, $queryError);
$error = mysqli_fetch_assoc($error);
$error = $error['image'];
echo $error;
}else
{
$image = mysqli_fetch_assoc($image);
$image = $image['image_posts'];
echo $image;
}


?&gt;
</code></pre>
