Hello there,
Im having a problem with the following sql statement.
SELECT * FROM property_list LEFT JOIN photo_list ON property_list.Property_ID = photo_list.Property_ID WHERE Main_Pic = '1'
The above statement works. It retrieves a property and only the main picture of that property.
I want to add another WHERE statement to select a property by its id, so it looks something like this.
SELECT * FROM property_list LEFT JOIN photo_list ON property_list.Property_ID = photo_list.Property_ID WHERE Main_Pic = '1' AND Property_ID = $propertyid
What is the correct way to go about doing this?
Thanks in advance.
Phil