Here is my code
<table class="table table-bordered table-striped table-hover" id="tblSchedule">
<thead>
<tr>
<?php
$days=array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
for ($i=0;$i<COUNT($days);$i++) {
echo "<th>".$days[$i]."</th>";
}
?>
</tr>
</thead>
<tbody>
<?php
$days=array("Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday");
echo "<tr>";
for ($x=0;$x<COUNT($days);$x++) {
$get_schedule=getData("SELECT * FROM acadsoc_class_schedule WHERE class_day=? AND username=?",array($days[$x],$_SESSION['username']));
foreach ($get_schedule as $schedule) {
echo "<tr>";
echo "<td>".$schedule->class_time."</td>";
echo "</tr>";
}
}
echo "</tr>";
?>
</tbody>
</table>