i am using this code to display a full MySQL Table:
$sql="SELECT * FROM billing ";
$rs=mysql_query($sql,$conn);
$fields_num = mysql_num_fields($rs);
echo "<table border='1'><tr>";
for($i=0; $i<$fields_num; $i++) {
$field = mysql_fetch_field($rs);
echo "<td>{$field->name}</td>";
}
echo "</tr>\n";
while($row = mysql_fetch_row($rs)) {
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "</tr>\n";
}
this is showing every column heading but only 2 columns data
how can i make it show all columns without having to list each column name/array number?