harkly Posted June 29, 2010 Share Posted June 29, 2010 Can someone take a look at my query? It was working until I add the 2nd Left Join. Never had more that one Join in my quieries so not really sure of what I am doing. $query = ("SELECT user.userID, user.gender, user.bd_year, user.city, user.state, photos.userID, photos.photo_1, about_me.smoking, CURDATE(), YEAR(CURDATE())-YEAR(birth_date)) - (RIGHT(CURDATE(),5)<RIGHT(birth_date,5)) AS age FROM user LEFT JOIN photos ON user.userID = photos.userID LEFT JOIN about_me ON user.userID = about_me.userID WHERE user.bd_year <= $year1 AND user.bd_year >= $year2 AND user.gender = $genderPref AND about_me.smoking = $smoke"); Link to comment https://forums.phpfreaks.com/topic/206209-left-join-query-not-working/ Share on other sites More sharing options...
Gamic Posted July 3, 2010 Share Posted July 3, 2010 What are you trying to show? Link to comment https://forums.phpfreaks.com/topic/206209-left-join-query-not-working/#findComment-1080687 Share on other sites More sharing options...
harkly Posted July 3, 2010 Author Share Posted July 3, 2010 Thanks I got it to work. Link to comment https://forums.phpfreaks.com/topic/206209-left-join-query-not-working/#findComment-1080854 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.