Ajax,PHP和MySql

I'm having a problem with Ajax. Nothing happen when I change my select value.

I have a div with the id textHint in order to print the result.

Here is my select :

<form>              
    <select id="choix" name="choix" onchange="showUser(this.value)">
        <div class="tutorial_list">
            <?php 
                $db = mysql_connect('localhost', 'root', 'root'); 
                mysql_select_db('Projet',$db); 

                $sql = 'select NomPromo, NumPromo from Promo';
                $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

                while ($data = mysql_fetch_array($req)){
                     echo'<option value="'.$data['NumPromo'].'">'.$data['NomPromo'].'</option>';
                }
            ?>
        </div>
    </select>
</form>

Here's my script :

<script>
    function showUser(str) {
        if (str == "") {
           document.getElementById("txtHint").innerHTML = "";
           return;
           } else { 
                if (window.XMLHttpRequest) {
                    // code for IE7+, Firefox, Chrome, Opera, Safari
                    xmlhttp = new XMLHttpRequest();
                } else {
                    // code for IE6, IE5
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                }
                xmlhttp.onreadystatechange = function() {
                    if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
                        document.getElementById("txtHint").innerHTML = xmlhttp.responseText;
                    }
                };
                xmlhttp.open("GET","data.php?q="+str,true);
                xmlhttp.send();
        }
    }
</script>

And here's my data.php :

<?php 

    $q = intval($_GET['q']);

    $db = mysql_connect('localhost', 'root', 'root'); 
    mysql_select_db('Projet',$db);

    $sql = "select Nom, Prenom from User where Groupe ='".$q."'";
    $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

    while ($data = mysql_fetch_array($req)){
         echo $data['Nom'].' '.$data['Prenom'];
    }
?>  

I don't understand what <div class='tutorial_list'></div> doing inside <select></select>

This error

[Error] ReferenceError: Can't find variable: $ (fonction anonyme)prof.php:75

may be because of few reasons. a) jquery library is not loaded correctly b) path could be not correct. Check this link

I've done little changes, you can try this out.

<form>              
  <select id="choix" name="choix">
    <div class="tutorial_list">
      <?php 
      $db = mysql_connect('localhost', 'root', 'root'); 
      mysql_select_db('Projet',$db); 

      $sql = 'select NomPromo, NumPromo from Promo';
      $req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());

      while ($data = mysql_fetch_array($req)){
           echo'<option value="'.$data['NumPromo'].'">'.$data['NomPromo'].'</option>';
      }
      ?>
    </div>
  </select>
</form>

JS

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>

<script>
  $(document).ready(function(){
    $('#choix').change(function(){
      var q= $('#choix').val();
      $.ajax({url:"data.php?q="+q,cache:false,success:function(result){
        $('#txtHint').html(result);
      }});
    });
  });
</script>

[NOTE: mysql_* functions are deprecated since PHP 5.5. Use mysqli_* or PDO]