I want to make a timetable in a HTML-table. I have a database structure set up and now I have trouble with displaying the database data in the HTML-table correctly.
My database structure involves:
The days are numbered by day_nr where 1 = monday, 2 = tuesday, 3 = wednesday, 4 = thursday and 5 = friday. The hours are numbered by hour_nr from 1 to 10.
Here is an example of what I eventually want to create.
Some code:
<?php
session_start();
// Connect MySQL Database
require("function.php");
$con = sql_connection();
// Select data from database (select the right table)
$result01 = mysqli_query("SELECT teacher_code, day_nr, hour_nr, subject_code, room_nr, class_code FROM `lesson`");
echo "<table class='table table-striped table-bordered student_table'>
<thead class='thead-inverse'>
<tr>
<th class='start_time'></th>
<th>Monday</th>
<th>Tuesday</th>
<th>Wednesday</th>
<th>Thursday</th>
<th>Friday</th>
</tr>
</thead>";