SELECT p.*, s.* FROM property p, state s, property2type p2t
WHERE
p2t.property_type_id = AND
p2t.property_id = p.property_id AND
p.site_id = 1 AND
p.property_active = 1 AND
p.state_id = s.state_id
ORDER BY p.state_id You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND
p2t.property_id = p.property_id AND
p.site_id = 1 AND
p.prope' at line 3