list.php
资源名称:minierp.rar [点击查看]
上传用户:yantgcom
上传日期:2013-07-19
资源大小:478k
文件大小:1k
源码类别:
MySQL数据库
开发平台:
PHP
- <?php
- include ("../inc/db.php");
- include ("../inc/phpmkrfn.php");
- include ('../inc/xtpl.php');
- include("../inc/pageft.php");
- $t_ORDER=$_GET['order'];
- if (empty($t_ORDER)){$t_ORDER="ID";}
- $xtpl=new XTemplate ("listview.html");
- $conn = phpmkr_db_connect(HOST, USER, PASS, DB, PORT);
- //总页数
- $sSql ="select AUTOID from accounts";
- $result=phpmkr_query($sSql,$conn);
- $total=phpmkr_num_rows($result);
- //调用pageft(),每页显示10条信息(使用默认的20时,可以省略此参数),使用本页URL(默认,所以省略掉)。
- pageft($total,15);
- $sSql ="select * from accounts order by $t_ORDER limit $firstcount,$displaypg";
- $rs = phpmkr_query($sSql,$conn) or die("Failed to execute query: " . phpmkr_error() . '<br>SQL: ' . $sSql);
- while ($row = mysql_fetch_array($rs, MYSQL_ASSOC)) {
- $xtpl->assign("DATA",$row); /* assign array data */
- $xtpl->parse("main.table.row"); /* parse a row */
- }
- $xtpl->parse("main.table"); /* parse the table */
- $xtpl->assign("PAGEINFO",$pagenav); //分页
- $xtpl->parse("main");
- $xtpl->out("main");
- //echo $pagenav;
- //include("../debug.php");
- ?>