Hey guys,
I have this code which gets some reults from a table and displays them:
echo "<table><tr>";
while($col = mysql_fetch_array($columns)){
echo "<th>".$col['COLUMN_NAME']."</th>";
}
echo "</tr>";
$i=0;
while($row = mysql_fetch_array($data)){
echo "<tr>";
foreach($row as $r){
echo "<td>".$r."</td>";
}
echo "</tr>";
}
echo "</table>";
Getting the column names is fine, but with the actual results it displays it twice for example:
Column1 Column2 Column3
result1 result1 result2 result2 result3 result3
result1 result1 result2 result2 result3 result3
Why is this happening?
Thanks in advance for any help. :)