使用jquery使用复选框更新

I'm trying to update my course_code into my database when the checkbox checked but it fail. I tried to modify from others but seem like I make mistake. can anyone tell me what is the problem?

here is my assigncourse.php

<?php require_once("../includes/session.php"); ?>
<?php require_once("sessioncourse.php"); ?>
<?php $course_codefac = $_SESSION['course_code'] ; ?>
<?php confirm_logged_in(); ?>
<?php require_once("../includes/connection.php") ?>
<?php require_once("../includes/functions.php") ?>


<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script>
function Change(id) {

 $.ajax({
     type: "GET",
     url: "updateassigncourse.php",
     data: {"id": id},
     'success': function (response) {
            console.log(response);
            //TODO: use server response
        }
 });
};
</script>

<?php include("includes/header.php"); ?>

  <div id="main">
  <div class="full_w">
   <?php
          $querysel = "SELECT * FROM tblstudent ORDER BY student_id " ;
      $resultsel = mysql_query($querysel, $connection);

      echo "<h2><div class=\"h_title\">Please tick the student to join this 
".$course_codefac." course</div></h2>";  
      echo "<table>";
      echo "<thead>";
      echo "<tr>";
      echo "<th scope=\"col\">Matric ID</th>";
      echo "<th scope=\"col\">Name</th>";
      echo "<th scope=\"col\">Assign</th>";
      echo "</tr>";
      echo "</thead>";


          while($rowsel = mysql_fetch_array($resultsel)){
        if($rowsel['course_code'] == NULL){
            $id = $rowsel['id'];
                    echo "<tr>";
                    echo "<tr>"."<td class=\"align-center\">".$rowsel['student_id']."  
</td>";
                    echo "<td class=\"align-center\">".$rowsel['name']."</td>";
        echo "<td class=\"align-center\">";
        echo "<input type=\"checkbox\" onchange=\"javascript:  
Change($id);\">";
echo "</td>";

        }
      }
      echo "</table>";




   ?>
  </div>
  </div>
<?php include("includes/footer.php"); ?>

then here is my updateassigncourse.php

<?php require_once("../includes/session.php"); ?>
<?php require_once("sessioncourse.php"); ?>
<?php $course_codeapp = $_SESSION['course_code'] ; ?>
<?php confirm_logged_in(); ?>
<?php require_once("../includes/connection.php") ?>
<?php require_once("../includes/functions.php") ?>

<?php

$id = $_GET['id'];
$course = $course_codeapp;

$sql="UPDATE tblstudent set course_code  = ". mysql_real_escape_string($course) 
." WHERE id = " .mysql_real_escape_string($id);

$result = mysql_query($sql);

?>

If this is your exact code, then there is a missing ';'

$course = $course_codeapp

it should have been

$course = $course_codeapp;