Database error: Invalid SQL: SELECT p.propertyID, count(rp.feature) as numFeatPhotos
FROM rental_photos rp, property p, owner o, cities_areas ca, cities c
WHERE rp.feature = 'Y'
AND p.visible = 'Y'
AND p.featured = 'Y'
AND rp.propertyID = p.propertyID
AND p.ownerID = o.ownerID
AND p.citiesAreasID = ca.citiesAreasID
AND ca.citiesID = c.citiesID
AND c.websiteID =
AND o.endSubDate > DATE(NOW())
GROUP BY p.propertyID
ORDER BY RAND()
MySQL Error: 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 o.endSubDate > DATE(NOW())
GROUP BY p.propertyID
ORDER BY RAND' at line 11)
Session halted.