下面是新聞模型舉列子,如果要自己的模型的就調自己的表
較新一篇:
<?php
$infoPreNext = $empire->fetch1("
select * from {$dbtbpre}ecms_news
where classid=$GLOBALS[navclassid]
and checked=1
and newstime>$navinfor[newstime]
order by newstime asc limit 1;
");
if(empty($infoPreNext[id])){
echo "沒有了";
}else{
echo "<a href='".sys_ReturnBqTitleLink($infoPreNext)."'>
<img src='".$infoPreNext[titlepic]."'>
</a>";
}
?>
較早前一篇:
<?php
$infoPreNext = $empire->fetch1("
select * from {$dbtbpre}ecms_news
where classid=$GLOBALS[navclassid]
and checked=1
and newstime<$navinfor[newstime]
order by newstime desc limit 1;
");
if(empty($infoPreNext[id])){
echo "沒有了";
}else{
echo "<a href='".sys_ReturnBqTitleLink($infoPreNext)."'>
<img src='".$infoPreNext[titlepic]."'>
</a>";
}
?>
新聞熱點
疑難解答