"group" mysql results for better performance of php -


i have table:

id, type, title 1, book, 1 2, music, tear 3, book, flow 4, music, yes 5, flower, green  select * table type in ( book, music ); 

but need somehow group results , able each type in php - in php echo "book" types should echo "one, flow". problem table contains 100 000s of lines , result well. need "pre-formatted" results php because must fast many rows. idea please?

try this.

select *, group_concat(title separator ', ') titles table type in ( book, music ) group type


Comments