title: json_encode in PHP not returning correct results
body: <p>I am trying to input data into a grid which has CRUD operations its called Jquery JTable, but there seems to be some sort of error with the Json conversion from the MYSQL table to JSON, for the data to be displayed on the table it needs to look kinda like this:</p>
  
  <pre><code>{
      "Result":"OK",
      "Records":[
        {"PersonId":1,"Name":"Benjamin Button","Age":17,"RecordDate":"\/Date(1320259705710)\/"},
        {"PersonId":2,"Name":"Douglas Adams","Age":42,"RecordDate":"\/Date(1320259705710)\/"},
        {"PersonId":3,"Name":"Isaac Asimov","Age":26,"RecordDate":"\/Date(1320259705710)\/"},
        {"PersonId":4,"Name":"Thomas More","Age":65,"RecordDate":"\/Date(1320259705710)\/"}
      ]
  }
  </code></pre>
  
  <p>But whenever I implement the <code>json_encode</code> function in php it gives me this:</p>
  
  <pre><code>{
      "Result":"OK",
      "Records":[
          {"0":"1","PersonId":"1","1":"Benjamin Button","Name":"Benjamin Button","2":"17","Age":"17","3":"2011-12-27 00:00:00","RecordDate":"2011-12-27 00:00:00"},
          {"0":"2","PersonId":"2","1":"Douglas Adams","Name":"Douglas Adams","2":"42","Age":"42","3":"2011-12-26 00:00:00","RecordDate":"2011-12-26 00:00:00"},
          {"0":"3","PersonId":"3","1":"Isaac Asimov","Name":"Isaac Asimov","2":"26","Age":"26","3":"2011-12-28 00:00:00","RecordDate":"2011-12-28 00:00:00"},
          {"0":"4","PersonId":"4","1":"Thomas More","Name":"Thomas More","2":"61","Age":"61","3":"2011-12-27 00:00:00","RecordDate":"2011-12-27 00:00:00"},
          {"0":"5","PersonId":"5","1":"Ihsan Oktay Anar","Name":"Ihsan Oktay Anar","2":"44","Age":"44","3":"2012-01-03 20:55:02","RecordDate":"2012-01-03 20:55:02"}
      ]
  }
  </code></pre>
  
  <p>Here is my PHP code:</p>
  
  <pre><code>&lt;?php
  
  //Get records from database
  $result = mysqli_query($conn, "SELECT * FROM people;");
  
  //Add all records to an array
  $rows = array();
  while($row = mysqli_fetch_array($result))
  {
      $rows[] = $row;
  }
  
  //Return result to jTable
  $jTableResult = array();
  $jTableResult['Result'] = "OK";
  $jTableResult['Records'] = $rows;
  print json_encode($jTableResult);
  
  ?&gt;
  </code></pre>
  
  <p>the table is called people and it has four fields: <code>personId</code>, <code>Name</code>, <code>Age</code> and <code>RecordDate</code>. </p>
  
  <p>Any ideas would be greatly appreciated.</p>