<?php
			 
			include("db.php");

$size = count($_POST['grades']);
$sizes = count($_POST['remarks']);


$i = 0;
while ($i < $size && $sizes ) {
	$grades= $_POST['grades'][$i];
	$remarks= $_POST['remarks'][$i];	
	$id = $_POST['studSemID'][$i];
	
	$query = "UPDATE studsem SET grades = '$grades', remarks = '$remarks' , status = 1 WHERE studSemID = '$id' LIMIT 1";
		mysql_query($query) or die ("Error in query: $query");
			++$i;
				header("location: reciept.php");
}

	mysql_close($conn);
	
	  ?>
		