I have a MySQL table with the following data. I want to display the corresponding MySQL query result in columns. Its is questions and answers survey. There are 47 questions in a survey. SO when a user submit a survey, it will save all the 47 answers with their corresponding questionId in the table. So instead of having 47 rows of answers, I want to have it in 1 row with 47 columns. Please click on this link to see MySQL table records as example
Now what I want to achieve is
Q1 | Q2 | Q3 | Q4 |--- |Q47
-----------------------------------------------------
Answer | answer |answer |answer |answer