MySQL: Multiple Photos and Videos for News with Joins

Satoph

New Member
I want \[code\]multiple photos\[/code\] and \[code\]multiple videos\[/code\], the main problem is that I can't get them \[code\]inline\[/code\] if I don't use joins.So for example, I get \[code\]2 photos\[/code\] a \[code\]video\[/code\] and again a \[code\]photo\[/code\].I have a parent \[code\]news\[/code\] table and 2 secondary table \[code\]news_photos\[/code\] and \[code\]news_videos\[/code\] and I want to get in \[code\]one query\[/code\] the \[code\]photos\[/code\] and \[code\]videos\[/code\] for the \[code\]news\[/code\].Is this somehow possible?\[code\]mysql_query(" SELECT * FROM news_photos, news_videos FULL JOIN news_videos ON news_id = {$news_id} FULL JOIN news_photos ON news_id = {$news_id}");\[/code\]An image about the structure:
Xt0VM.png
 
Back
Top