// submission if (isset($_POST['submit2'])) { $rows = $_POST['rows']; $shifts = array(3,1,2); // set the timestamp to be midnight today so data will always be between startDate and endDat $year = strftime("%Y", $startDate); $month = strftime("%m", $startDate); $day = strftime("%d", $startDate); $date = mktime(24, 0, 0, $month, $day, $year); // populate columns $columns = array(); array_push($columns, "date", "group"); for ($i=0; $i"; } } // UPDATE table_name SET column_name = new_value, column_name2 = new_value2,.... WHERE column_name = some_value elseif ($stage == "edit") { for ($i=0; $i"; } } }