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"); Quote 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? Quote 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. Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.