$PageListNum    =   30;
        $TotalNum       =   $DB->numRows($DB->query("select * from ftpfile where operate_id='".$_SESSION['sUserName']."' $sql order by ftpsite_id"));
        $TotalPage      =   $TotalNum/$PageListNum;
        if($TotalPage<=1) {
         $TotalPage  =   1;
        }
        else {
         if (!is_int($TotalPage))
{                $TotalPage = floor($TotalPage)+1;

            }        }
        if(!$kpub->input["CurrentPage"]) {
         $CurrentPage    =   1;
        }
        else {
         $CurrentPage    =   $kpub->input["CurrentPage"];
        }
        $StarListNum    =   ($CurrentPage-1)*$PageListNum;
        for($ii=1; $ii<=$TotalPage; $ii++) {
            if($ii==$CurrentPage) {
             $selected   =   "selected";
            }
            else {
             $selected   =   "";
            }
         $option .=  "<option value='$this->ThisUrl&ftpOption=ftpindex&ftpid=".$kpub->input['ftpid']."&CurrentPage=$ii' $selected >$ii</option>\n";
        }        $PageShowMsg    =   "<table ".$INFO['table3'].">\n<tr  >\n<td align=right ".$INFO['title3'].">这是第".$CurrentPage."页 共有".$TotalPage."页 ".$PageListNum."每页 <select             onChange=javascript:location.href(this.options[this.selectedIndex].value) size=1 name=select2>\n$option</select> &nbsp; &nbsp; </td>\n</tr>\n</table>\n";//打开链接
$query2      =   $DB->query("select * from ftpfile where operate_id='".$_SESSION['sUserName']."' $sql order by ftpsite_id limit $StarListNum,$PageListNum");给你写一下思路:
设置每页的显示数目
取回所有的记录数
取回当前显示第几页的页数
如果当前显示第几页的页数为空是,取为1
取记录要用 select * from yourtable order by time limit 第几页的页数*每页显示的数目,每页显示的数目最主要的是用mysql的limit,限制读取数据库记录的某一段,看来说不明白,下一个留言板自己看吧!