$db=dblink();
$db->pagesize=20;
$sql="select id from collect where vtype=$vtype";
$db->execute($sql);
$strpage=$db->strpage();
//将分页字符串保存在临时变量,方便输出while($rs=$db->fetch_array()){
$strid.=$rs['id'].',';
}
$strid=substr($strid,0,strlen($strid)-1);
//构造出id字符串$db->pagesize=0;
//很关键,在不注销类的情况下,将分页清空,这样只需要用一次数据库连接,不需要再开;$db->execute("select
id,title,url,sTime,gTime,vtype,tag from collect where id in ($strid)");
<?php while($rs=$db->fetch_array()): ?>
<?php echo $rs['id'];?> <?php echo $rs['url'];?> <?php echo $rs['sTime'];?> <?php echo $rs['gTime'];?> <?php echo $rs['vtype'];?>target="_blank"><?php echo $rs['title'];?>
<?php echo$rs['tag'];?>
?>
echo $strpage;
?>