What's the best way to make a select in this case, and output it without using nested queries in php? I would prefer to make it with a single query.
My tables look like this:
table1 id | items | ---|-------| 1 | item1 | 2 | item2 | 3 | item3 | .. | .. | table2 id | itemid | comment | ---|--------|----------| 1 | 1 | comment1 | 2 | 1 | comment2 | 3 | 2 | comment3 | 4 | 3 | comment4 | 5 | 3 | comment5 | 6 | 3 | comment6 | .. | .. | .. |
This is the output i'm looking for.
item1 comment1 comment2 item2 comment3 item3 comment4 comment5 comment6
Thanks in advance