PHP随机信息调用

180it 2020-02-16 AM 1931℃ 0条
<?php
$hits_r = $empire->query("select * from {$dbtbpre}ecms_news as t1 join (select round(rand() * ((select max(id) from {$dbtbpre}ecms_news)-(select min(id) from {$dbtbpre}ecms_news))+(select min(id) from {$dbtbpre}ecms_news)) as id) as t2  where t1.id >= t2.id and t1.classid = {$GLOBALS['navclassid']} order by t1.id limit 10"); //查询新闻表最新10条记录
$i==0;
while($r=$empire->fetch($hits_r)) //循环获取查询记录
{
    $titleurl=sys_ReturnBqTitleLink($r); //标题链接
    $i++;
?> <li class="<?=$i?>"><a href="<?=$titleurl?>" title="<?=$r['title']?>"><?=$r['title']?></a></li> <?php
}
$empire->free($hits_r);
?>
支付宝打赏支付宝打赏 微信打赏微信打赏

如果文章或资源对您有帮助,欢迎打赏作者。一路走来,感谢有您!

标签: none

PHP随机信息调用