手册
目录
收藏824
分享
阅读32653
更新时间2022-04-11
|
|
| <?php require('../../class/connect.php'); //引入数据库配置文件和公共函数文件 require('../../class/db_sql.php'); //引入数据库操作文件 require('../../data/dbcache/class.php'); //引入栏目缓存文件 $link=db_connect(); //连接MYSQL $empire=new mysqlquery(); //声明数据库操作类 $editor=1; //声明目录层次 $sql=$empire->query("select * from
{$dbtbpre}ecms_news order by newstime limit 10"); //查询新闻表最新10条记录 db_close(); //关闭MYSQL链接 |
|
<?php if(!defined('InEmpireCMS')) { exit(); } ?> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>显示最新10条新闻例子</title> </head> <body> <br> <br> <br> <table width="500" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC"> <tr> <td height="25"><strong>显示最新10条新闻:</strong></td> </tr> <tr> <td height="25" bgcolor="#FFFFFF"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <?php while($r=$empire->fetch($sql)) //循环获取查询记录 { $titleurl=sys_ReturnBqTitleLink($r); //标题链接 ?> <tr> <td width="67%" height="25">·<a href="<?=$titleurl?>" target="_blank"> <?=esub(stripslashes($r[title]),32)?> </a></td> <td width="33%"><div align="center">[<?=date('Y-m-d',$r[newstime])?>]</div></td> </tr> <?php } ?> </table> </td> </tr> </table> </body> </html> |

相关
视频
RELATED VIDEOS
科技资讯
1
2
3
4
5
6
7
8
9
精选课程
共5课时
17.3万人学习
共49课时
77.4万人学习
共29课时
62万人学习
共25课时
39.5万人学习
共43课时
71.3万人学习
共25课时
61.9万人学习
共22课时
23.1万人学习
共28课时
34.1万人学习
共89课时
125.8万人学习