Passing Looped Array Values From PHP to JavaScript & JQuery
<p>I am trying to make a search box in my web application, and I used ajax post to make a request to my server. My question is:</p>

<p>Is it possible to send looped array values from PHP to my JavaScript?
I want to get all of the results from my server.</p>

<p>CLIENT SIDE: Ajax POST request</p>

<pre><code>&lt;script type="text/javascript"&gt;
$(document).ready( function() {
   $.ajax({
       type: "POST",
       url: "searchPlaces.php",
       data: { searchInput: form.searchTxtId.value },
       success: function (result)
       {
            // Get the search result
       }
   });
});
&lt;/script&gt;
</code></pre>

<p>SERVER SIDE (after retrieving the post from ajax, and making queries):</p>

<pre><code>while ($result = mysql_fetch_assoc ($query))
{
   $resultName = $result['name'];
   $resultAddress = $result['address'];
}
</code></pre>
