RECORDS_PER_PAGE=$rpp; $this->TABLE_NAME=$tb; $this->SORT_STR=$str; if ( $tt == 0 ) { $query = "SELECT COUNT(*) FROM $tb"; $this->PAGE_TOTAL= ceil(value_from_db($query)/$this->RECORDS_PER_PAGE); } else $this->PAGE_TOTAL=$tt; } public function page_table($page) { global $db_obj; $start = ($page-1) * $this->RECORDS_PER_PAGE; $query = "SELECT * FROM $this->TABLE_NAME ORDER BY $this->SORT_STR LIMIT $start, $this->RECORDS_PER_PAGE"; $result=$db_obj->query($query); if ( $result ) echo (htmlTable($result,"db")); else return FALSE; } public function page_nav($page) { $total=$this->PAGE_TOTAL; echo "\n"; } private $RECORDS_PER_PAGE, $TABLE_NAME, $SORT_STR, $PAGE_TOTAL; } ?>