title: Return two variables in ajax success function
body: <p>How can I return BOTH the parcel number and the number of comments in one single function? I have two separate sql strings returning different results. I would like to be able to return both the apn number and put the value into a label and the count of how many comments there are. Is this possible? How do I do this?</p>
  
  <p>Jquery:</p>
  
  <pre><code>$.ajax({
      url: "classes/get-apn-count-comments.php?parcel_id=" + parcel_id,
      type: "GET",
      data: { parcel_id : parcel_id },
      dataType: 'json',
      error: function(SMLHttpRequest, textStatus, errorThrown){
          alert("An error has occurred making the request: " + errorThrown);
      },
      success: function(data2){
          //do stuff here on success
          //$('#ParcelNumber').html(data[0]["apn"]);
          $('#ViewComments').val('View ' + data2[0].count + ' Comments');
      }
  });
  </code></pre>
  
  <p>PHP:</p>
  
  <pre><code>&lt;?php
  require_once('../config.php');
  
  if(isset($_GET['parcel_id'])) {
      $db = new ezSQL_mysql(DB_USER, DB_PASSWORD, DB_NAME, DB_HOST);
  
      //get the apn based on id
      //$data = $db-&gt;get_results("select apn from parcels where parcel_id=" . $_GET['parcel_id']);
      //if($data != null) echo json_encode($data);
  
      //count number of comments for the id
      $data2 = $db-&gt;get_results("select count(*) as count from comments where parcel_id=" . $_GET['parcel_id']);
      echo json_encode($data2);
  }
  
  ?&gt;
  </code></pre>