SELECT
p.property_id, p.address_1, ct.city_town, sp.state_province, p.num_beds, p.num_baths, p.otherFees_1,
p.pets_allowed, p.smoking_allowed, i.image
FROM properties p
LEFT JOIN property_images pi ON pi.property_id = p.property_id
LEFT JOIN images i ON i.image_id = pi.image_id
LEFT JOIN cities_towns ct ON ct.city_town_id = p.city_town_id
LEFT JOIN states_provinces sp ON sp.state_province_id = p.state_province_id
WHERE p.cat_featured = 1
AND p.property_type_id =
AND p.property_id !=
GROUP BY p.property_id ORDER BY RAND() LIMIT 10
[nativecode=1064 ** 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 p.property_id !=
GROUP BY p.property_id ORDER BY RAND() LIMIT 10' at line 14]