title: How to return all result rows resulting from a SQL statement execution to the page where the AJAX request came from
body: <p>How to fetch all result rows in MySQL+PHP?</p>
  
  <p>You know, if I use <code>mysql_fetch_assoc()</code>  , it only returns one result row as an associative array. I am using AJAX to fetch the data in a MySQL table.</p>
  
  <pre><code>$result=mysql_query("select * from questions where announcementid='$taskid'")or die(mysql_error());
  </code></pre>
  
  <p>How to return the value of $result which is an array to the page where an Ajax request was fired?</p>