Mr Chris Posted September 14, 2006 Share Posted September 14, 2006 Hi,I'm trying in PHP to call out an SQL statement to enter data from 3 tables, now i've done it with two:[b]Select * FROM `cms_competitions` LEFT OUTER JOIN cms_competition_pics ON cms_competitions.competition_id = cms_competition_pics.competition_id WHERE cms_competitions.competition_id=".$_GET['competition_id'],$link);[/b]But how do include another table ie cms_competition_logos?I understood a two table join, but a three i'm confused on?ThanksChris Quote Link to comment https://forums.phpfreaks.com/topic/20733-calling-data-from-3-mysql-tables/ Share on other sites More sharing options...
gerkintrigg Posted September 14, 2006 Share Posted September 14, 2006 you'd normally do it with commas... FROM member, item, category....but to do it with a left join, I'm not sure. You might need to use () to encapulate each LEFT OUTER JOIN command and then add a comma and another () to encapsulate another.Try writing what you want to do in plain english (or your mother language if different) and translate it into pseudo code (semi-logical PHP). That might help. Quote Link to comment https://forums.phpfreaks.com/topic/20733-calling-data-from-3-mysql-tables/#findComment-91857 Share on other sites More sharing options...
Ninjakreborn Posted September 14, 2006 Share Posted September 14, 2006 It's alot easier, and in my opinion a lot easier to mantain, to just do 1 db call, then the other db call after that. Quote Link to comment https://forums.phpfreaks.com/topic/20733-calling-data-from-3-mysql-tables/#findComment-91885 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.