Jaynesh Posted July 11, 2011 Share Posted July 11, 2011 Hello I have query I would like to know how I would go about doing this. (highlighted in red) Joining share.user_id with something other then dbPosts. SELECT * FROM dbPosts LEFT JOIN dbUsers ON dbPosts.username_id = dbUsers.id LEFT JOIN dbPosts_share ON share.user_id = dbFriends.friend_id Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/ Share on other sites More sharing options...
Kustom_Vegas Posted July 11, 2011 Share Posted July 11, 2011 should be able to simply add another table into your join statement.. "SELECT * FROM dbPosts, dbUsers, tbl_2 WHERE dbPosts.username_id = dbUsers.id AND share.user_id = tbl_2.field" Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/#findComment-1241376 Share on other sites More sharing options...
Jaynesh Posted July 11, 2011 Author Share Posted July 11, 2011 hi is there no way of doing by still using LEFT JOIN? Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/#findComment-1241385 Share on other sites More sharing options...
Kustom_Vegas Posted July 11, 2011 Share Posted July 11, 2011 what i gave you is a form of a join, why do you need the word JOIN in the statement if my method works? But if you insist...here Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/#findComment-1241401 Share on other sites More sharing options...
Jaynesh Posted July 11, 2011 Author Share Posted July 11, 2011 Hi Isnt left joins and inner joins a more healthier alternative? Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/#findComment-1241403 Share on other sites More sharing options...
fenway Posted July 14, 2011 Share Posted July 14, 2011 You seem to be posting a lot of topics on the same single item. Link to comment https://forums.phpfreaks.com/topic/241677-joining-multiple-tables/#findComment-1242495 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.