title: Output as array
body: <pre><code>       $result = mysql_query(" SELECT p.page_url AS url,
                                 COUNT(*) AS occurrences 
                                 FROM page p, word w, occurrence o
                                 WHERE p.page_id = o.page_id AND
                                 w.word_id = o.word_id AND
                                 w.word_word = \"$keyword\"
                                 GROUP BY p.page_id
                                 ORDER BY occurrences DESC
                                 " );
  
  $output = "&lt;loginsuccess&gt;";
  
  for( $i = 1; $row = mysql_fetch_array($result); $i++ )      {
  
  
  $output .="&lt;keyword&gt;".$_POST['keyword']."&lt;/keyword&gt;&lt;name&gt;".$row['url']."&lt;/name&gt;&lt;occur&gt;".$row['occurrences']."&lt;/occur&gt;&lt;queryTime&gt;".(substr($end_time-$start_time,0,5))."&lt;/queryTime&gt;";
  }
  
  $output .= "&lt;/loginsuccess&gt;";
  print ($output);
  </code></pre>
  
  <p>I am gettign the output in XML, instead i want it in array... how to achieve this.</p>
  
  <p>The code below is not working... </p>
  
  <pre><code>$ret = array();
  for( $i = 1; $row = mysql_fetch_array($result); $i++ )      {
  
       $tmp['url'] = $row['url'];
       $tmp['occurrences'] = $row['occurrences'];
  
       $ret[] = $tmp;
  
  }
   return $ret;
  </code></pre>