title: what is the error in this mysql query
body: <pre><code>SELECT `p`.`id`, `p`.`propertyname`, `p`.`location`, `p`.`a_unit`, `p`.`t_unit`, pgi.img_name 
  FROM `properties`  p,(select gallery_id from  property_addom as pa 
  where  p.id=pa.p_id) as a join propert_gallery_images as pgi ON a.gallery_id=pgi.pg_id
  </code></pre>
  
  <p>when i execute it will show me the error </p>
  
  <blockquote>
    <p><code>#1054</code> - Unknown column 'p.id' in 'where clause' and properties table contain id coloumn</p>
  </blockquote>