Hey guys,
I have some code which returns the column names, but not the actual data. Here is the code I have:
$success = mysql_query($final) or die(mysql_error());
echo "<table><tr>";
foreach($_POST['fields'] as $f){
echo "<th>".$f."</th>";
}
echo "</tr>";
$i=0;
while($row = mysql_fetch_assoc($success)){
echo "<tr>";
foreach($row as $r){
echo "<td>".$r."</td>";
$i++;
}
echo "</tr>";
}
echo "</table>";
This displays the correct column names in the table, but doesn't display any results. I've checked that $final contains a correct string by echoing it so it can be seen, but nothing is shown. The only thing I can think of is if $r needs square brackets containing a column name?
Thanks in advance for any help :)