wispas Posted February 26, 2010 Share Posted February 26, 2010 I have this SQL query at the moment: SELECT * FROM city INNER JOIN packages ON packages.city_code = city.city_code WHERE city_id='$id'; I have another table i want to inner join called hotel. Does anyone know how to add this into the SQL query above. Quote Link to comment https://forums.phpfreaks.com/topic/193461-multiple-inner-joins/ Share on other sites More sharing options...
fenway Posted February 26, 2010 Share Posted February 26, 2010 Just add yet another join. Quote Link to comment https://forums.phpfreaks.com/topic/193461-multiple-inner-joins/#findComment-1018588 Share on other sites More sharing options...
zeodragonzord Posted March 1, 2010 Share Posted March 1, 2010 You do the same thing, just add another INNER JOIN clause. SELECT * FROM city INNER JOIN packages ON packages.city_code = city.city_code INNER JOIN hotel ON tableIAmJoiningOn.field = hotel.hotelField WHERE city.city_id='$id'; Quote Link to comment https://forums.phpfreaks.com/topic/193461-multiple-inner-joins/#findComment-1020104 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.