Hi there,
I have written a script that outputs a selected record with 6 fields from a mysql table into an html table. The table has 2 rows; the 1st row just has the cell name and the 2nd row contains the data from the table. Each row has 6 columns. It looks a little like this.
Head1 Head2 Head3 Head4 Head5 Head6
Field 1 Field 2 Field3 Field 4 Field 5 Field6
I'd like to format the table as follows:
Head1 Field1 Head4 Field4
Head2 Field2 Head5 Field5
Head3 Field3 Head6 Field6
The parto of code I currently use to create the table is
while($row = mysql_fetch_row($result))
{
echo '<tr>';
echo '<td>' . $row[3]. '</td>';
echo '<td>' . $row[4] . '</td>';
echo '<td>' . $row[5] . '</td>';
echo '<td>' . $row[6] . '</td>';
echo '<td>' . $row[7] . '</td>';
echo '<td>' . $row[8] . '</td>';
echo '</tr>';
}
It's a bit difficult to explain exactly what I mean so I hope it's clear enough.
Any suggestions would be most welcome.
Thanks,
Tim.