<input name="h" type="hidden" id="h" value="0" />
$num = $_POST['h'];
for ($i=0; $i<=$num; $i++)
value = 0 and 0<=0 is only one loop 😉
you set in html h to 0, so $num is allways 0.
you can set $num to the count of submited rows by
$num = count($_POST['activityname']);
but that works only if you fill out the activityname field or you can set the $num to the count of your rows.
8
solved All columns not inserted in the database