Hi everyone. I'm learning PHP and I am trying to display the content of a table. It works except it always skips the first row.
This is the code I am using:
$query_rsTable = "SELECT * FROM {$tablename} ORDER BY id ASC";
$rsTable = mysql_query($query_rsTable, $connCooking) or die(mysql_error());
$fields_num = mysql_num_fields($rsTable);
echo "<table border='1'><tr>";
// printing table headers
for($i=0; $i<$fields_num; $i++)
{
$field = mysql_field_name($rsTable,$i);
echo "<td>$field</td>";
}
echo "</tr>";
while ($get_info = mysql_fetch_row($rsTable)){
echo $get_info;
echo "<tr>\n";
foreach ($get_info as $field)
echo "\t<td><font face=arial size=1/>$field</font></td>\n";
echo "</tr>\n";
}
echo "</table>\n";
What am I doing wrong?
Thanks a bunch
Rob