A Database Error Occurred

Error Number: 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 img.img_type='MICROSITE_TEMPLATE_IMAGE' and img.status=1 order by img.id des' at line 1

SELECT pro.property_name, img.id, img.image FROM tsr_images img INNER JOIN tsr_microsites ms ON img.microsite_template_id=ms.id INNER JOIN tsr_properties pro ON ms.propty_id=pro.id WHERE img.microsite_template_id= and img.img_type='MICROSITE_TEMPLATE_IMAGE' and img.status=1 order by img.id desc limit 3

Filename: /var/www/html/my_app_ms/models/microsites/model_microsite.php

Line Number: 4514