Mysql concat column on table while joining from another to php

cicin

New Member
Here's the basic layout:\[code\]Table1: id 1o, blah id 11, testTable2: id 1, 10, some info id 2, 10, more info id 3, 11, more info\[/code\]What query using sql would allow me to display the results like so, when using php and mysql_fetch_object:\[code\]10, blah, more info, some info11, test, more info\[/code\]Right now, I have:\[code\]select * from table1join (table2, table3)on (table2.id = table1.id and table3.id = table1.id)\[/code\]The problem with this is that I get multiple result rows for the same id because of the multiple values in tables 2 and 3.EDIT: I got it to work!\[code\]select table1.id, group_concat(table2.data), table3.datafrom table1join (table2, table3)on (table2.id = table1.id and table3.id = table1.id)group by table1.id\[/code\]
 
Back
Top