Hi im trying to convert a multidimensional array into a database but none of the values are being added in. Currently ive set up a foreach loop in order to access the different levels of the array and bind paramaters with those vatriables. I get the error "Method call uses 5 parameters, but mehtod signature uses 3 " But i dont think that is the main problem with my code. MY database structure is a only a single table with 4 columns (Day
, Hour
, Subject
'id')
foreach ($timetable as $day => $subTimetable) {
foreach ($subTimetable as $hour => $subject) {
$conn = mysqli_connect("localhost", "root", "");
$db = mysqli_select_db($conn, "test");
$stmt =mysqli_prepare($conn,"INSERT INTO `timetable` (`Day`, `hour`, `subject`) VALUES (?, ?, ?);");
mysqli_stmt_bind_param($stmt, 'sss', $Day, $hour, $subject);
mysqli_stmt_execute($stmt);
}