title: ARRAY PHP How to put variables in array
body: <p>Hi guys i would like to ask help on my problem..  </p>
  
  <p>I have 4 variables made from my query:  </p>
  
  <pre><code>$sql1 = mysql_num_rows(mysql_query("SELECT * FROM tbl_reservation WHERE YEAR(date_added) = YEAR(NOW()) AND order_action = 'Online Transaction' "));
  
  $sql2 = mysql_num_rows(mysql_query("SELECT * FROM tbl_reservation WHERE YEAR(date_added) = YEAR(NOW()) AND order_action = 'Walkin Transaction' "));
  
  $sql3 = mysql_num_rows(mysql_query("SELECT * FROM tbl_reservation WHERE YEAR(date_added) = YEAR(NOW())-1 AND  order_action = 'Online Transaction' "));
  
  $sql4 = mysql_num_rows(mysql_query("SELECT * FROM tbl_reservation WHERE YEAR(date_added) = YEAR(NOW())-1 AND  order_action = 'Walkin Transaction' "));
  </code></pre>
  
  <p>I would like to put them in an array..to be exactly on my expectations.  </p>
  
  <p>Here is my sample code:</p>
  
  <pre><code>$stack = array($sql1, $sql2);
  array_push($stack, $sql3, $sql4);
  $query = print_r($stack);
  $result = $query;
  
  
  print json_encode($result);
  </code></pre>
  
  <p>It display like this on my browser:<br>
  Array ( [0] => 0 [1] => 8 [2] => 0 [3] => 1 ) true  </p>
  
  <p>But i want to display it like this:
  [{"0","1"},
  {"2","3"}]  </p>
  
  <p>I am planning to make a line graph on this.. I have a Chart.min.js and jquery.min.js</p>
  
  <p>If any way.. The whole point.. i want to make a line graph that would compare my data from current year to last year.  </p>
  
  <p>Help me pls. :(</p>