title: Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given
body: <p>i am getting this error when trying to perform the following query:</p>
  
  <pre><code>$sql = mysql_query("select c.id as id_car, c.year, c.make, c.model, c.type, c.colour, 
                             (select count(*) from `parts` where `id_car`=c.id and `is_packaged`='yes') as partcount
                             from `cars` as c 
                             where partcount &gt; 0
                             group by c.id
                             order by `id` desc");
  </code></pre>
  
  <p>the problem seems to be the <code>where partcount &gt; 0</code>. it seems to be seeing the 0 as a boolean when trying to make the comparison?</p>