帝国CMS PHP调用范例
2018-03-26 站长 站长日志
帝国CMS使用PHP调用方法可以调用数据库中任何信息,
例如调用评论表数据:
1 2 3 4 5 6 7 |
<?php
$sql = $empire ->query( "select * from {$dbtbpre}enewspl_1 order by saytime limit 10" );
while ( $r = $empire ->fetch( $sql )) //循环获取查询记录
{
echo "<li><span class='time'>" . date ( 'm-d' , $r [saytime]). "</span><a target=_blank href='/e/action/ShowInfo.php?classid=" . $r ['classid ']."&id=".$r[' id ']."' >". $r [ 'saytext' ]. "</a></li>" ;
}
?>
|