Mailinglisten-Archive |
> und wie müsste dann die abfrage lauten wenn ich jeden content haben möchte
> von region europa??
> das ist ja mein hauptproblem
>
>>>TABELLE1
>>>
>>> | id | content |
>>> |1 |text1 |
>>> |2 |blabla |
>>> ...
>>>
>>>TABELLE2
>>>
>>>| informationid | countryid |
>>>|1 |2 |
>>>|1 |16 |
>>>|2 |99 |
>>>...
>>
>>TABELLE3
>>
>>| countryid | regionid |
>>| 2 | 2 |
>>| 3 | 1 |
>>| 7 | 1 |
>>
>>TABELLE4
>>
>>| regionid | name |
>>| 1 | Europa |
>>| 2 | Asien |
SELECT *
FROM `TABELLE4`
LEFT JOIN `TABELLE3`
ON `TABELLE4`.`regionid` = `TABELLE3`.`regionid`
LEFT JOIN `TABELLE2`
ON `TABELLE3`.`countryid` = `TABELLE2`.`countryid`
LEFT JOIN `TABELLE1`
ON `TABELLE2`.`informationid` = `TABELLE1`.`id`
WHERE `TABELLE4`.`regionid` = [region]
--
Sebastian Mendel (www.sebastianmendel.de)
*www.warzonez.de* | www.tekkno4u.de | www.nofetish.com
--
Infos zur Mailingliste, zur Teilnahme und zum An- und Abmelden unter
-->> http://www.4t2.com/mysql
php::bar PHP Wiki - Listenarchive