U moet de selectievakjes een expliciete index geven in de HTML:
$i = 0;
while($shift_query = $result_shift_query->fetch_assoc())
{
echo "<tr>";
echo "<td><input type=\"hidden\" name=\"Shift_ID[]\"></td>";
echo "<td><input type=\"text\" name=\"Shift_Name[]\"></td>";
echo "<td><input type=\"text\" name=\"Shift_Short_Name[]\"></td>";
echo "<td><input type=\"text\" name=\"Shift_Color[]\"></td>";
echo "<td><input type=\"checkbox\" name=\"Shift_Trig[$i]\"";
if($shift_query['Shift_Trig'] == '1')
{
echo " checked=\"checked\"";
}
echo " value=\"1\"></td>";
echo "<td><input type=\"checkbox\" name=\"deleteBox[$i]\"></td>";
echo "</tr>";
$i++;
}
Doe in de updatecode aan het begin van de lus:
if (!isset($trig[$i])) { $trig[$i] = 0; }
De rest van de updatecode is ongewijzigd.