SELECT field1,
GROUP_CONCAT(field2) AS field2
FROM your_table
GROUP
BY field1
will return this:
field1 field2
------ ------
name1 value1, value2, value3
name2 value4, value5
From there, use you could use str_replace() in your loop to replace the commas with a <br /> and a -