软讯网络 > 网站建设 > PHP > 数据库操作类与page.php结合应用例子
【标 题】:数据库操作类与page.php结合应用例子
【关键字】:
page.php
【来 源】:http://www.cublog.cn/u/18908/showart.php?id=176823
数据库操作类与page.php结合应用例子
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<?php
$keywords=substr(stripslashes($_GET['key']),1,-1);
require_once "include/page.php";
require_once "include/dbconn.php";
$maxline = 10;
mysql_query("set names gb2312");
$sql="select * from news where keywords like '%$keywords%' ";
$news = $dbc->getGopageRs($sql,$maxline);
//echo "$sql";
$gopage = new GoPage($dbc->tpages,$dbc->total);//建立翻页程序
$backurl = "newstitle.php?".$dbc->getParameter();
for($i=0;$i<$dbc->num_rows;$i++)
{
echo "<tr><td><p><a href=".$news[$i]['url']." target=\"_blank\">".$news[$i]['title']."</a></p></td></tr>";
}
?>
<tr>
<td align="center"><?=$gopage->style(0)?></td>
</tr>
</table></td>
【相关文章】
没有相关文章