i have 2 tables.
pages
+-----------+----------+------------+ | id | title | url | +-----------+----------+------------+ | 1 | test | test.html | | 2 | test2 | test2.html | +-----------+----------+------------+
files
+-----------+----------+------------+ | id | page_id | name | +-----------+----------+------------+ | 10 | 1 | a.jpg | | 11 | 1 | b.jpg | | 12 | 2 | c.jpg | +-----------+----------+------------+
how select pages 1 row , files multi rows??
my query as:
select * pages,files (pages.id = page_id) , (url='$url')
the output above query:
test a.jpg
the output need:
test a.jpg b.jpg
this more of sql question php.
think want, i'm not sure wording.
select pages.title, files.name pages inner join files on pages.id = files.page_id (pages.url='$url') group files.name;