Unknown column 'Array' in 'where clause' -database error
<pre><code>public function count_category_images($p_id)
{
$this-&gt;db-&gt;select('gallery.*','category.category_name');
$this-&gt;db-&gt;join('category', 'category.id = gallery.category_id');
$this-&gt;db-&gt;order_by('gallery.id','desc');
$this-&gt;db-&gt;where('category.id',$p_id); 

return $this-&gt;db-&gt;count_all_results('gallery');//line no 81
}
</code></pre>

<p>am getting this error </p>

<blockquote>
  <p>Error Number: 1054 Unknown column 'Array' in 'where clause'</p>
</blockquote>

<pre><code>SELECT
    COUNT(*) AS `numrows`
FROM
    `gallery`
JOIN `category` ON `category`.`id` = `gallery`.`category_id`
WHERE
    `category`.`id` = `Array`
ORDER BY
    `gallery`.`id` DESC
</code></pre>

<p><strong>Filename: C:/wamp64/www/rox/application/models/roxmodel.php</strong></p>

<p>Line Number: 81</p>