分页时查询条件保存不住

浏览:1863 发布日期:2013/09/29 分类:求助交流
谁能帮忙看一下这段代码,哪里有错误,查询条件怎么也保存不了。

import('ORG.Util.Page'); // 导入分页类
$map['type'] = $_POST['type'];
$map['variety'] = $_POST['variety'];
$count = $standard->where($map)->count();
$Page = new Page($count, 20); // 实例化分页类 传入总记录数和每页显示的记录数
//分页跳转的时候保证查询条件
foreach ($map as $key => $val) {
if (!is_array($val)) {
$Page->parameter .= "$key =" . urlencode($val) . "&"; //传入参数值
}
}

$show = $Page->show(); // 分页显示输出
$arr = $standard->where($map)->limit($Page->firstRow . ',' . $Page->listRows)->order('week')->select();

补充:SELECT * FROM `ch_standard` WHERE ( `type` = null ) AND ( `variety` = null ) ORDER BY week LIMIT 20,20 [ RunTime:0.000177s ]
传来的数据为空。
最佳答案
评论( 相关
后面还有条评论,点击查看>>