首页 >后端开发 >php教程 >php与mysql分页问题,为什么别的界面都能用单独这个的下一页不能用,这么写有问题,该怎样修改

php与mysql分页问题,为什么别的界面都能用单独这个的下一页不能用,这么写有问题,该怎样修改

WBOY
WBOY原创
2016-06-02 11:32:59752浏览

php

function get_links_list_all($key)
{
$result = get_filter();
if ($result === false)
{
$ filter = array();
$filter['sort_by'] = 空($_REQUEST['sort_by']) ? 'user_id' : 修剪($_REQUEST['sort_by']);
$filter['sort_order'] = 空($_REQUEST['sort_order']) ? 'DESC' : trim($_REQUEST['sort_order']);
$sql = 'SELECT COUNT(*) FROM ' .$GLOBALS['ecs']->table('users')." WHERE employee_key ='$key'";
$filter['record_count'] = $GLOBALS['db']->getOne($sql);

<code>    $filter = page_and_size($filter);   $sql  = 'SELECT * FROM ' .$GLOBALS['ecs']->table('users').            " WHERE employee_key='$key'";    set_filter($filter, $sql);}else{    $sql    = $result['sql'];    $filter = $result['filter'];}$res = $GLOBALS['db']->selectLimit($sql, $filter['page_size'], $filter['start']);$list = array();while ($rows = $GLOBALS['db']->fetchRow($res)){    date_default_timezone_set('PRC');    $rows['reg_time']=date('Y-m-d H:i:s',$rows['reg_time']);    $list[] = $rows;}return array('list' => $list, 'filter' => $filter, 'page_count' => $filter['page_count'], 'record_count' => $filter['record_count']);</code>

}

声明:
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn