<?php 
   $adv_bottom=mysql_query("Select * From tbladvertise WHERE type='bottom'"); 
?>
<div class="clear" style="height: 8px;"></div>
<?php while($row_adv_bottom=mysql_fetch_array($adv_bottom)){ 
    if(!empty($row_adv_bottom['image'])){
        if(!empty($row_adv_bottom['link'])){
            echo '<a href="'.htmlspecialchars($row_adv_bottom['link']).'" target="_blank"><div id="box_bd_ads"><div id="img_ads" style="overflow: hidden; text-align: center; display: flex; align-items: center; justify-content: center;">
                <img src="images/ads/'.$row_adv_bottom['image'].'" style="width: 100%; height: 100%; object-fit: contain; display: block; border: 0;" />
            </div></div></a>';
        }else{
            echo '<div id="box_bd_ads"><div id="img_ads" style="overflow: hidden; text-align: center; display: flex; align-items: center; justify-content: center;">
               <img src="images/ads/'.$row_adv_bottom['image'].'" style="width: 100%; height: 100%; object-fit: contain; display: block; border: 0;" />
            </div></div>';
        }
    }
 } ?>
<div class="clear" style="height: 20px;"></div>