I am working with php, mysql and I want to do exactly what
this link says.
In the w3schools example it prints:
NAME ORDER NO.
Ola Hansen 22245
Ola Hansen 47475
Ola Hansen 45854
But I need:
NAME ORDER NO.
Ola Hansen 22245, 47475, 45854
It has to do with data manipulation on PHP or do I need to change something on the query….?
Thanks in advance,
Niki
Both ways are possible.
You can use group_concat() in mysql (along with GROUP BY of course). But keep in mind that default size of the data returned by this function is just 1024 bytes.
Or you can do it with data manipulation in PHP – sometimes it’s going to be more flexible