title: How to send PHP variables and retrieve them with Jquery (without echo)?
body: <p>I'm building a search function to retrieve XML data for a google map. </p>
  
  <p>In addition to that, I want to display how many results were actually found. </p>
  
  <p>I thought about doing an echo inside the actual document, however that might mess with my marker data. How would I take a PHP variable and retrieve it in Jquery after a success call?</p>
  
  <p>If my PHP looked like this:</p>
  
  <pre><code>$result = mysql_query($query);
  if (!$result) {
    die('Invalid query: ' . mysql_error());
  }
  $num_rows = mysql_num_rows($result);
  </code></pre>
  
  <p>And Jquery like this:</p>
  
  <pre><code>    $.ajax({
          type: "POST",
          url: "MapSearchxml.php",
          data: {
              dataFromDate: FromDate,
              //lalala
              dataHasPatio: HasPatio
          },
          beforeSend: function (html) { // this happens before actual call
              $("#results").html('Please Wait');
              $("#searchresults").show();
              $(".phpFromDate").html(FromDate);
          },
          success: function (data, status, jqXHR) {
  
          //Success?
          },
          dataType: 'xml'
      });
  </code></pre>