title: result fromm ajax request goes to error function
body: <p>i have a drop-down select tag use for showing the data from my database i also use ajax request to fetch my data from database but the problem i encounter is that when i get the result it how on my <code>error:function()</code></p>
  
  <pre><code>admin_table.on('click', '#pay', function() {
      $tr = $(this).closest('tr');
  
      var data = admin_table.row($tr).data();
      $(document).on('click', '#dr_1', function(){
          $.ajax({
              type:'POST',
              url:'../functions/ajax/get_delivery_receipts.php',
  
              data:{
                  id: data['user_id']
              },
              dataType:'JSON',
              sucess: function(data){
                  console.log(data);
              },
              error: function(err){
                  console.log(err.responseText);
              }
          });
      });
  }); 
  </code></pre>
  
  <p>this is my function.. reason for that structure is the <code>'#pay'</code> is a button from the table.. and <code>'#dr_1'</code> is inside the modal that pop up when the 1st id is a click.</p>
  
  <pre><code>if (isset($_POST)) {
      $id = $_POST['id'];
      $res = $db-&gt;dr($id);
      echo json_encode($res);
  } 
  </code></pre>
  
  <p>and this is inside the ajax request.</p>
  
  <pre><code>public function dr($id)
  {
      $sql="SELECT * FROM tbl_delivery WHERE user_id = '$id'";
      var_dump($sql);
      $stmt = $this-&gt;dbh-&gt;prepare($sql);
      $stmt-&gt;execute();
      $data = array();
      while($row = $stmt-&gt;fetch(PDO::FETCH_ASSOC)){
          $data[] = $row;
      }
      return $data;
  }
  </code></pre>
  
  <p>and this is my query</p>