Friday, September 20, 2019

php - MySQL group duplicates together

I have a MYSQL database which looks like this:



 ID      | Name    | Product
--------+---------+----------
65644 | Charlie | Beer
65644 | John | Beer
65644 | Jan | Beer
65644 | Phoebe | Beer

65644 | Shaun | Beer


I would like to output a table using php to look something like this:



 ID      |               Name                | Product
--------+-----------------------------------+----------
65644 | Charlie, John, Jan, Phoebe, Shaun | Beer



Currently I've only been able to output it to look like this first table. Any help would be greatly appreciated.

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...