With work you could replace the <tr>'s with \N and the <td>'s with \T, but here's the basic concept:
<table>
<?php
//get your resource as $result
while($rd = mysql_fetch_array($result)){ $a++;
//this will add a header for the first array fetch ----------------
if($a==1){
echo "<tr>";
foreach($rd as $n=>$v){
if(!is_numeric($n)){
echo "<td>$n</td>";
}
}
echo "</tr>";
}
//end of header ----------------
echo "<tr>";
foreach($rd as $n=>$v){
if(!is_numeric($n)){ #<-- key phrase right here
echo "<td>$v</td>";
}
}
echo "</tr>";
}
?>
</table>
The key phrase is "if $n is not numeric" as you see above. This is because mysql_fetch_array returns the array as both a list of filed NAMES and also numeric indexes. Since each of your field names are NEVER numeric, you screen the same column from showing up twice.
I added a header for your convenience.
Sam Fullman
Compass Point Media