Jump to content

Calling data from 3 MySQL tables


Mr Chris

Recommended Posts

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?

Thanks

Chris
Link to comment
https://forums.phpfreaks.com/topic/20733-calling-data-from-3-mysql-tables/
Share on other sites

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.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.