I'm currently trying to put php results into an HTML table, and not sure why it is not working. The first block returns the data I need, so I know it's not a sql query issue. The second block (where I try to make it a table) returns the headers but no data.
Here is my code:
<h1>
<?php
while (odbc_fetch_row($weekadmissions)) // while there are rows
{
print odbc_result($weekadmissions, "date") . ", " .
odbc_result($weekadmissions, "attendance") .
"<br />
";
}
?>
</h1>
<?php
print "<table><tr>";
print "<th>Date</th>";
print "<th>Attendance</th></tr>";
while (odbc_fetch_row($weekadmissions)) // while there are rows
{
print "<tr><td>" . odbc_result($weekadmissions,"date") . "</td>";
print "<td>" . odbc_result($weekadmissions, "attendance") . "</td></tr>";
}
print "</table>";
?>
Thanks!