I have a page that generates a table dynamicly from a query, woks great.
The header is printed out like,
for($i=0; $i<$fields_num; $i++){
$field = mysql_fetch_field($result);
echo "<th>{$field->name} </th>";
works great..
Now im trying to add a footer, and nesting two loops is kicking my but !!
before printing check to see if columb name is same as
key name in array, and if so print only the value
if not, just an empty cell
for($i=0; $i<$fields_num; $i++){
$field = mysql_fetch_field($result);
foreach ($rowsreturned as $columb =>$total){
if ("{$field->name}"=="$total"){
echo "<td>{$total->value} </td>";
} else {
echo "<td></td>";
}
}
}
Anyone know what the foolishness is ?