Home > Backend Development > PHP Tutorial > 大量数据分页有关问题

大量数据分页有关问题

WBOY
Release: 2016-06-13 13:39:58
Original
883 people have browsed it

大量数据分页问题
就是将一些信息从表t*读取进来,然后在另一个页面添加自己所关注的信息,也就是browse表的东西,比如关注的事youxi或者qq。然后对t*读取的数据里面有此类字的整行数据进行读取。之前我做的是读十条进来然后判断一下,有的读出来,就是下面的代码,这样就出现有些页一条都没有,有些页只有一两条。之后我用select   *   from     t*   where   Op_h   like   %row[brow]   or   like   row   ............limit   $page   $pagesize。这样倒是可以,但是数据量大,添加的关注多了根本就读不出数据。希望各位大侠能给一些好的意见和建议。


include( "../inc/nois.php ");
include( "../inc/db_conn.php ");
$conn   =   new   dbClass();
$conn-> Connect();

$sql_page   =   "select   count(*)   from   t*;
$rs_page   =   $conn-> RetuenRow($sql_page);
$count   =   mysql_fetch_row($rs_page);

$url=$_SERVER[ 'REQUEST_URI '];
$url=parse_url($url);
$url=$url[path];

//当页显示数目
$pagesize=10;
//得到当前最大页数
$pageindex=$count[0]/$pagesize;
if($_GET[page])
{
$pagenum=$_GET[page];
$page=($pagenum-1)*$pagesize;
$page.= ', ';
}

?>





     
   
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template