php banner rotater problem
<p>i want to create dynamic banner rotater wih php ajax i want to pass the mysql_fetch_array() to an array to create a new array() to create xml response..........</p>

<p>here is my code</p>

<pre><code>$sql = mysql_query("SELECT * FROM ads");
header('Content-type: text/xml');
echo '&lt;?xml version="1.0" ?&gt;';
while($row = mysql_fetch_array($sql)){
    $title = $row['title'];
    $img = $row['file'];
    $body = $row['body'];
    $ban = '&lt;b&gt;'.$title.'&lt;/b&gt;&lt;br&gt;&lt;br&gt;&lt;img src="ads/'.$img.'"&gt;&lt;br&gt;&lt;br&gt;'.$body;

    $banners = array(    
      $ban,    
    );    
    $html = $banners[array_rand($banners)];

}

&lt;banner&gt;
    &lt;content&gt;&lt;?php echo htmlentities($html); ?&gt;&lt;/content&gt;
    &lt;reload&gt;3000&lt;/reload&gt;    
&lt;/banner&gt;
</code></pre>

<p>but it is return only one ad not return multiple ads how can i fix that</p>
