使用这个方法获得数据库连接,然后在类之外遍历,这样开销较小 * 如果结果集不是很大,可以直接使用getPageData的方式获取二维数组格式的结果 * getPageData方法也是调用本方法来获取结果的 * ***/ function getDataLink() { if ( $this->numItems ) { global $db; $PageID = $this->CurrentPageID; $from = ($PageID - 1)*$this->PageSize; $count = $this->PageSize; $link = $db->limitQuery($this->sql, $from, $count); //使用Pear DB::limitQuery方法保证数据库兼容性 return $link; } else { return false; } } /*** * * 以二维数组的格式返回结果集 * ***/ function getPageData() { if ( $this->numItems ) { &n上一页 [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] 下一页 |