php查询结果的分页显示,点击下一页时不能记寓所查询的东西,只要点击下页时, 显示出来的 结果却是全部数据
程序员文章站
2022-05-26 12:19:07
...
php查询结果的分页显示,点击下一页时不能记住所查询的东西,只要点击下页时, 显示出来的 结果却是全部数据 。
[
------解决思路----------------------
所有 '.php?page='
都改为 '.php?select=' . $select .'&page='
------解决思路----------------------
把你搜索的字段内容也传过去
// 获取select值
$select_value = isset($_GET['select']) ? $_GET['select'] : '';
//echo $select_value;
//执行查询SQL
if($select_value==""){
_page("SELECT o_id FROM t_order",5);
$_result= mysql_query("SELECT * FROM t_order ORDER BY createtime DESC LIMIT $_pagenum,$_pagesize");
}
if($select_value=="option1"){
_page("SELECT o_id FROM t_order where status=0",4);
$_result1= mysql_query("SELECT * FROM t_order where status=0 ORDER BY createtime DESC LIMIT $_pagenum,$_pagesize");
//echo _num_rows($_result);
}
if($select_value=="option2"){
_page("SELECT o_id FROM t_order where status=1",20);
$_result= mysql_query("SELECT * FROM t_order where status=1 ORDER BY createtime DESC LIMIT $_pagenum,$_pagesize");
}
if($select_value=="option3"){
_page("SELECT o_id FROM t_order where status=2",20);
$_result= mysql_query("SELECT * FROM t_order where status=2 ORDER BY createtime DESC LIMIT $_pagenum,$_pagesize");
}[code=php]
[
------解决思路----------------------
所有 '.php?page='
都改为 '.php?select=' . $select .'&page='
------解决思路----------------------
把你搜索的字段内容也传过去
相关文章
相关视频