<? 
  $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");
   .....