title: json_encode and highcharts
body: <p>I'm trying to make graphs in PHP and MySQL using jQuery, specifically with Highcharts library, I have managed to make the chart with data from MySQL database, but these data show some data if they are in the databases but not others, for example, a query that yields 10 results 5 are good, but the other five did not, I have done some research on the web and I understand it is due to a problem when I pass the result of my query in MySQL by json_encode, I hope some of you can tell me because I have this error or if I'm misusing the JSON, thank you very much.
  Code: 
   index.php</p>
  
  <pre><code>    &lt;html&gt;
  &lt;head&gt; 
      &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"/&gt; 
      &lt;title&gt;Incidencias&lt;/title&gt;
      &lt;script type="text/javascript" src="../js/jquery-1.7.1.min.js" &gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../js/highcharts.js" &gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../js/themes/grid.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript" src="../js/export.js"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
          var chart;
              $(document).ready(function() {
                  var options = {
                      chart: {
                          renderTo: 'pieClientes',
                          defaultSeriesType: 'pie',
                          marginRight: 10,
                          marginBottom: 25
                      },
                      title: {
                          text: 'top 10. Clientes con m\u00e1s incidencias',
                          x: -10  
                      },
                      subtitle: {
                          text: '',
                          x: -20
                      },
                      tooltip: {
                          formatter: function() {
                              return '&lt;b&gt;'+ this.point.name +'&lt;/b&gt;: &lt;b&gt;'+ this.y +' incidencias&lt;/b&gt;';
                          }
                      },
                      legend: {
                          layout: 'vertical',
                          align: 'right',
                          verticalAlign: 'top',
                          x: -10,
                          y: 100,
                          borderWidth: 0
                      },
  
                  series: [{
                      type: 'pie',
                      name: 'Browser share',
                      data: []
                  }]
              }
  
              $.getJSON("datosCliente.php", function(json) {
                  options.series[0].data = json;
                  chart = new Highcharts.Chart(options);
              });
              });
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;div style="font-size: 12p; font-family: Calibri, Candara, Segoe, Segoe UI, Optima, Arial, sans-serif; align="left" &gt;
          &lt;h1&gt;Dashboard incidencias SCI&lt;/h1&gt;
      &lt;div&gt;
      &lt;div id="pieClientes" style="width: 770px; height: 450x; margin: 0"&gt;&lt;/div&gt;              
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>datosCliente.php</p>
  
  <pre><code>&lt;?php
      include"../clases/conexion.php";
      $result = mysql_query("SELECT 
                      clientes.cliente,
                      COUNT(incidencias.idIncidencia) AS nIncidencias
                      FROM incidencias
                      INNER JOIN clientes ON incidencias.idCliente = clientes.idCliente
                      GROUP BY incidencias.idCliente
                      ORDER BY nIncidencias DESC
                      LIMIT 0,10");
      $rows = array();
          while($r = mysql_fetch_array($result)) 
              {
                  $row[0] = $r[0];
                  $row[1] = $r[1];
                  array_push($rows,$row);
              }
  
      //print json_encode($rows, JSON_PRETTY_PRINT);
      echo json_encode($rows, JSON_NUMERIC_CHECK | JSON_PRETTY_PRINT); 
      mysql_close($con);
  ?&gt; 
  </code></pre>
  
  <p>The error is for example when I want to show 10 row of the database in  the graph, it show me the results of this form: </p>
  
  <pre><code>      1st. row-&gt;  show me "slice" 
        2nd. row-&gt; the registerok,
        3th. row-&gt;  show me "slice"
        4. row-&gt; the registerok,
        5. row-&gt; the registerok,
        6.row-&gt; show me "slice"
       7.row-&gt;the registerok,
       8.row-&gt; show me "slice"
       9.row-&gt;the registerok,
      10.row-&gt; show me "slice"
  </code></pre>
  
  <p>The problem is that in the graph (pie) displays correct data but not others, it is as if some records or tubiese skipped a limit of 5 registrros, not I do not know where I'm wrong. :(</p>
  
  <p>thanks for helping :)</p>