<?
$n=0;
$query=mysql_query("select count(*) as sm from $book_table ");
$row=mysql_fetch_array($query);
$count=$row[sm];
if(empty($offset))
{$offset=0;}/////// 在这里检查 $offset 的值
$query=mysql_query("select * from $book_table order by book_id desc limit $offset,$list_num") or die ("fail");
.....
$n=0;
$query=mysql_query("select count(*) as sm from $book_table ");
$row=mysql_fetch_array($query);
$count=$row[sm];
if(empty($offset))
{$offset=0;}/////// 在这里检查 $offset 的值
$query=mysql_query("select * from $book_table order by book_id desc limit $offset,$list_num") or die ("fail");
.....
下面的$newoffset=$offset+$list_num;时,
$offset不是为20了吗?为什么不能跳到下一页
是不是程序又执行了 if(empty($offset))
{$offset=0;}
使值又变为0 呢??
那又如何改呢?
$offset=$_GET['offset'];
else
$offset=0;