You won’t make 50 columns. The purpose is that all these records are on the same line to insert into an array in php and then insert into an excel spreadsheet that the application will generate. I will replace each id with: First Row, Second Row, Third Row, Fourth Row.
I don’t think you can do what you want, even if you can, I don’t think it would be a good solution. Think about how to solve this with PHP and not with Mysql. I think it will be the best way.
Only one problem, Mysql only supports 4066 columns. Could explain why you want to do this?
– David
You won’t make 50 columns. The purpose is that all these records are on the same line to insert into an array in php and then insert into an excel spreadsheet that the application will generate. I will replace each id with: First Row, Second Row, Third Row, Fourth Row.
– Jorgito da Silva Paiva
I don’t think you can do what you want, even if you can, I don’t think it would be a good solution. Think about how to solve this with PHP and not with Mysql. I think it will be the best way.
– David
that’s called Pivot Table, here in the OS a question with good examples of code: https://stackoverflow.com/questions/7674786/mysql-pivot-table
– Ricardo Pontual
Take a look in that reply
– adventistaam