Odaku128 Posted August 21, 2010 Share Posted August 21, 2010 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 Link to comment https://forums.phpfreaks.com/topic/211362-left-join-with-multiple-where-statements/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.