Im trying to convert a multidimensional array into a single table in a database but receive the following error "Fatal error: Uncaught exception 'mysqli_sql_exception' with message 'Column 'Day' cannot be null' in C:\xampp\htdocs\Timetable\projects\TimetableAlgorithmn.php:27" I tried defining the variables manually but it still came up with the same error so I believe the foreach loop is fine.
mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
$link = mysqli_connect("localhost", "root", "","test");
$stmt =mysqli_prepare($link,"INSERT INTO timetable VALUES (?, ?, ?);");
foreach ($timetable as $day => $subTimetable) {
foreach ($subTimetable as $hour => $subject) {
mysqli_stmt_bind_param($stmt,'iis', $Day, $hour, $subject);
mysqli_stmt_execute($stmt);
}