|
发表于 2005-4-25 18:32:09
|
显示全部楼层
[PHP]<?php
Session_Start();
include_once('/usr/share/adodb/tohtml.inc.php');
include_once('dblink/mylink.php');
$sql='select * from cpjcsj order by cpdm';
$rs = $db->Execute($sql);
$f1=$rs->fields;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>产品基础数据</title>
</head>
<body>
<u><div align="center">产品基础数据</div></u>
<hr align="center" size="2">
<?php
$mydim="border=2 cellpadding=3 bgcolor='#F1F1F1'";
$num_of_rows_per_page=8;
$fieldheader=array('产品代码','产品代号','产品名称','产品识别码');
if (isset($HTTP_GET_VARS['next_page']))
$curr_page = $HTTP_GET_VARS['next_page'];
if (empty($curr_page)) $curr_page = 1; ## at first page
$rs = $db->ageExecute($sql, $num_of_rows_per_page, $curr_page);
if (!$rs) die('Query Failed');
if (!$rs->EOF && (!$rs->AtFirstPage() || !$rs->AtLastPage())) {rs2html($rs,$mydim,$fieldheader);?>
<hr align="left" size="3" width="100%" noshade>
<?php
if (!$rs->AtFirstPage()) {
?>
<a href="<?php echo $PHPSELF,'?next_page=',$rs->AbsolutePage() - 1 ?>">上一页</a>
<?php
}
if (!$rs->AtLastPage()) {
?>
<a href="<?php echo $PHPSELF,'?next_page=',$rs->AbsolutePage() + 1 ?>">下一页</a>
<?php
}
// rs2html($rs,$mydim,$fieldheader);
};
session_write_close();
$db->close();
?>[/PHP]
</body>
</html>
以上是我的一个程序中进行浏览的一部分,使用了ADODB类库,不知是否是你想要的? |
|