Hi, I just looked over the code I sent and I saw that there is a bug there. Here's the corrected version. This one is tested and it works fine
$query="SELECT * from $tbl"; $result=mysql_db_query($db,$query) or mysql_die(); echo "<table>"; while ($line = mysql_fetch_assoc($result)) { if (!$firstrow){ echo "<tr>"; while(list($col_name, $col_value) = each($line)) { print "\t\t<td><p align=center>$col_name</p></td>\n"; $firstrow.="\t\t<td><p align=center>$col_value</p></td>\n"; } echo "</tr>"; echo "<tr>$firstrow</tr>"; } else{ echo "<tr>"; while(list($col_name, $col_value) = each($line)) { print "\t\t<td><p align=center>$col_value</p></td>\n"; } echo "</tr>"; } } echo "</table>"; Hope this helps Dobromir Velev Web Developer http://www.websitepulse.com/ -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]