$advertisement_query = mysql_query("SELECT * FROM andesite_advertisement ORDER BY advertisement_title DESC");
$num_log = mysql_num_rows($advertisement_query);
if($num_log > 0){
$ads_ase = $advertisement_log_row['advertisement_base'];
$is_buyed_query = mysql_query("SELECT * FROM andesite_adsrice WHERE adsrice_username = '$user_nickname'");
$is_buyed_row = mysql_fetch_assoc($is_buyed_query);
$timeA = $is_buyed_row['adsrice_time'];
$timeB = date("d.m.Y H:i");
$timeDiff = strtotime($timeB) - strtotime($timeA);
if($timeDiff > $ads_time){
while($advertisement_log_row = mysql_fetch_array($advertisement_query)){
echo '

'.$advertisement_log_row['advertisement_id'].'
'.$advertisement_log_row['advertisement_title'].'
 '.ls_view.'

';
}
}


}else{
echo '

'.ls_nothata.'
'.ls_nothata.'
'.ls_nothata.'

';
}
?>