title: Jquery: Encoding and decoding json to/from php
body: <p>I have a jquery function as follows : </p>
  
  <pre><code>$(document).on("click",".ball_link", function fetchLevels(){
       $.getJSON('fetch_level.php',{level: clicked_ball}, function(data) {
          $.each(data, function() {
          alert(data);
          });
      });
  });
  </code></pre>
  
  <p>My fetch_level.php file looks like this :</p>
  
  <pre><code>$clicked_ball=$_GET["level"];
  $sqlget="select * from level_flow where parent_level='$clicked_ball'";
  $resultget=mysql_query($sqlget);
  
  $response_array=array();
  while($rowget=mysql_fetch_assoc($resultget)){
      $response_array[]=$rowget;
  }
  
  echo json_encode($response_array);
  </code></pre>
  
  <p>The query returns 3 rows across 5 columns (all ints). I want to be able to access each of those 15 values, but alert(data) in the js code gives this :</p>
  
  <pre><code>([object],[Object]),([object],[Object]),([object],[Object])
  </code></pre>