title: is it possible to get two different json output
body: <p><strong>is it possible to get two json output on a single page result set</strong></p>
  
  <blockquote>
    <p>I have to populate data-grid and chart by passing data to another page using ajax and get tow types of json result set from single mysql query, when I try to return json it fails to handle</p>
  </blockquote>
  
  <p>here is my <strong>result.php</strong> code where json will be generated,</p>
  
  <pre><code>include('connection.php');
  if (isset($_POST)) {
      $rep_date1 = $_POST['date1'];
      $date1 = date("Y-m-d", strtotime($rep_date1));
      $rep_date2 = $_POST['date2'];
      $date2 = date("Y-m-d", strtotime($rep_date2));
      $sql = mysql_query("SELECT * FROM infra.prob_report WHERE prob_rept_date    BETWEEN '$date1' AND '$date2'");
      $rows = array();
      while ($row = mysql_fetch_assoc($sql)) {
          $nestedData = array();
          $nestedData[] = $row["rep_id"];
          $nestedData[] = $row["prob_rept_date"];
          $nestedData[] = $row["prob_equip_name"];
          $nestedData[] = $row["prob_rept_name"];
          $nestedData[] = $row["prob_desc"];
          $data[] = '&lt;tr&gt;&lt;td&gt;'.$row["rep_id"].
          '&lt;/td&gt;&lt;td&gt;'.$row["prob_rept_date"].
          '&lt;/td&gt;&lt;td&gt;'.$row["prob_equip_name"].
          '&lt;/td&gt;&lt;td&gt;'.$row["prob_rept_name"].
          '&lt;/td&gt;&lt;td&gt;'.$row["prob_desc"].
          '&lt;/td&gt;&lt;/tr&gt;';
          $point = array("label" =&gt; $row['prob_equip_name'], "y" =&gt; $row['rep_id']);
          array_push($data_points, $point);
      }
      echo json_encode($data); //json output populating data-grid
      echo json_encode($data_points); //json output populating chart
  }
  </code></pre>
  
  <p>here is my <strong>handle.php</strong> where my handling script runs,</p>
  
  <pre><code>&lt;script&gt;
      $(document).ready(function() {
  
          $('#submit').click(function() {
              var name = $("#name").val();
              event.preventDefault();
              $.ajax({
                  type: "POST",
                  url: "new_prob_submit.php",
                  data: {
                      'date1': $('#picker1').val(),
                      'date2': $('#picker2').val()
                  },
                  dataType: "json",
                  success: function(data) {
                      $('#tbdy').html(data);
                      $.getJSON("result.php", function(result) {
                          var chart = new CanvasJS.Chart("chartContainer", {
                              data: [{
                                  dataPoints: result
                              }]
                          });
                          chart.render();
                      });
                  }
              });
          });
      });
  &lt;/script&gt;
  </code></pre>