$result=mysql_question("select * from banner_ads order by rank desc"); echo("
"); while($row=mysql_fetch_object($result)){ $img=$row->img; echo("
"); $count++; if(is_int($count/7)){ echo("
"); } } echo("
"); ?>