$advertisement_query = mysql_query("SELECT * FROM andesite_adsrice INNER JOIN andesite_advertisement ON andesite_advertisement.advertisement_id WHERE andesite_adsrice.adsrice_username = '$user_nickname'");
$adsrice_query = mysql_query("SELECT * FROM andesite_advertisement");
$num_log = mysql_num_rows($advertisement_query);
if ($num_log > 0){
while (($ads_row = mysql_fetch_array($advertisement_query)) && ($ade_row = mysql_fetch_array($adsrice_query))) {
if($ads_row['adsrice_adsase'] == $ade_row['advertisement_base']){
$timeA = $ads_row['adsrice_time'];
$timeB = date("d.m.Y H:i");
$timeDiff = strtotime($timeB) - strtotime($timeA);
if ($timeDiff > $ads_time){
echo '
'.$ads_row['advertisement_id'].'
'.$ads_row['advertisement_title'].'
'.ls_view.'
';
}
}else{
echo '
'.$ads_row['advertisement_id'].'
'.$ads_row['advertisement_title'].'
'.ls_view.'
';
}
}
} else {
$ads_f_query = mysql_query("SELECT * FROM andesite_advertisement");
while($ads_f_row = mysql_fetch_array($ads_f_query)){
echo '
'.$ads_f_row['advertisement_id'].'
'.$ads_f_row['advertisement_title'].'
'.ls_view.'
';
}
}
?>