Forum Moderators: coopster
while ($row= mysql_fetch_array($result))
{
$indexx = $row["indexx"];
$semester = $row["semester"];
$day = $row["day"];
$time = $row["time"];
$instructor = $row["instructor"];
$location = $row["location"];
echo "<table>";
echo "<tr>";
echo " <td>Index</td>";
echo "<td>Semester</td>";
echo "<td>Day</td>";
echo "<td>Time</td>";
echo "<td>Instructor</td>";
echo "<td>Location</td>";
echo "</tr>";
echo "<tr>";
echo "<td>$indexx</td>";
echo "<td> $semester</td>";
echo "<td>$day</td>";
echo "<td>$time</td>";
echo "<td>$instructor</td>";
echo "<td>$location</td>";
echo "</tr>";
echo"</table>";
$count++ ;
} // end WHILE
var $class_rows=NULL;
while ($row= mysql_fetch_array($result)) {
$indexx = $row["indexx"];
$semester = $row["semester"];
$day = $row["day"];
$time = $row["time"];
$instructor = $row["instructor"];
$location = $row["location"];
$class_rows .= "
<tr>
<td>$indexx</td>
<td> $semester</td>
<td>$day</td>
<td>$time</td>
<td>$instructor</td>
<td>$location</td>
</tr>
";
$count++; // No idea why you need this.
// but it could easily replace any value
// you'd get from num_rows
} // end WHILE
//
if ($class_rows) {
echo "
<table>
<tr>
<td>Index</td>
<td>Semester</td>
<td>Day</td>
<td>Time</td>
<td>Instructor</td>
<td>Location</td>
</tr>
$class_rows
</table>
";
}
else { echo "<p>This course does not have a set schedule.</p>"; }