<?php
include_once($_SERVER["DOCUMENT_ROOT"]."/db.php");
$data = mysql_query("SELECT * FROM `rek` WHERE `ok`>NOW() AND `gold` = '1' ORDER BY RAND() LIMIT 3");
$imr=mysql_num_rows($data);
if($imr>0){
echo '<div class="title">Реклама</div>';
while ($row = mysql_fetch_assoc($data)){
echo '<div class="forlink"><a href="/go/'.$row['id'].'" class="links" target="_blank">'.win($row['name']).'</a></div>';
}
}
?>