results = @mysql_query($query,$cnx); $this->pageSize = $pageSize; if ((int)$resultpage <= 0) $resultpage = 1; if ($resultpage > $this->getNumPages()) $resultpage = $this->getNumPages(); $this->setPageNum($resultpage); } function getNumPages() { if (!$this->results) return FALSE; return ceil(mysql_num_rows($this->results) / (float)$this->pageSize); } function setPageNum($pageNum) { if ($pageNum > $this->getNumPages() or $pageNum <= 0) return FALSE; $this->page = $pageNum; $this->row = 0; mysql_data_seek($this->results,($pageNum-1) * $this->pageSize); } function getPageNum() { return $this->page; } function isLastPage() { return ($this->page >= $this->getNumPages()); } function isFirstPage() { return ($this->page <= 1); } function fetchArray() { if (!$this->results) return FALSE; if ($this->row >= $this->pageSize) return FALSE; $this->row++; return mysql_fetch_array($this->results); } function getPageNav($phpfile,$queryvars='',$maxNavItems=5) { //echo "params:".$queryvars; if (!$this->isFirstPage()) { $nav .= "page) $nav .= "$i "; else $nav .= " {$i} "; } if (!$this->isLastPage()) { $nav .= "