student_add after record added changed variable $key to session[batchid]

$sql = "INSERT INTO student_batch (StudentID, BatchID) values
('".$studentID."', '".$_SESSION['BatchID']."')";