title: json dataType is not working in jquery ajax method
body: <p>i'm just trying to query the database and display the result the jquery's ajax method but if i put the dataType property as json it is only logging the result which has only one object the following is my code:</p>
  
  <pre><code>//this is a method is an object which will be triggered after a selection was made
  lister: function () {
      //this is to target the object as it is inside an event
      var self = users;
      //the ajax call
      $.ajax({
          url: 'index.php',
          type: 'POST',
          data: self.config.form.serialize(),
          //this is the dataType    
          dataType: 'json',
          success: function (results) {
              //this for logging the result
              console.log(results);
          }
      });
  }
  </code></pre>
  
  <p>the php code</p>
  
  <pre><code>if(isset($_POST['q']) &amp;&amp; !empty($_POST['q'])){
      $na = $_POST['q'];
      $query = mysql_query("SELECT id,first_name, last_name 
                            FROM users WHERE users.first_name LIKE '$na%'");
  
      $num=mysql_num_rows($query);
      if($num &gt;= 1){
          while($row = mysql_fetch_array($query)){
              //encoding the result as json
              echo json_encode($row); 
          }
       } else{
          echo "no results found ";
       }
  
       //here we return so it won't display all of the pages
       return;
  }
  </code></pre>