johnjohn22 johnjohn22 - 1 year ago 29
MySQL Question

Return rows of data from mysql but handle them as a single record, possible?

I found a simular question here, but is there a way in mySql in my case?

I store the data like this (in order to be able to add any kind of data i want):

1 1 Created 2017-08-03
2 1 Name John Smith
3 1 Age 12

Would like to return it as this (to be able to sort/filter and calculate on it lika a single record) :

1 2017-08-03 John Smith 12

Is it possible with PHP, PDO and MYSQL?

Answer Source

Answering my own question if someone else is searching for something simular.

I ended up using GROUP_CONCAT to retrieve multiple row data into a single row, from that i could handle the data as i needed.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download