PHP - display HTML table as inverted mysql table
Posted on 2010-08-25
I have a mysql table that has 10 columns and 2 rows.
I can easly create a PHP script which will create an HTML table and display the data as is.
What I want to do is invert the rows and columns when displayed in HTML - ie...the 2 row titles from mysql become the column headings and the 10 columns from mysql become the first cells in each row in the the HTML table....obviously the data in the other cells will still be displayed in the right cells.
Can anyone show me a code example for how to achieve this?