Wildhalf Posted April 3, 2008 Share Posted April 3, 2008 Hi I am using a pagination script got from (http://phpsense.com/php/php-pagination-script.html) It uses the following line to decided how many pages to display. I want to display all my pages and this line of code should do it but doesn't The ceil function as i understand it should round up to the next integer. $this->max_pages = ceil($this->total_rows/$this->rows_per_page); There are 49 entries in my database and that should make max_pages = 5 but it only displays pages 1 2 3 4 but you can click the next arrow and it displays the fifth page but never sshow in in your list. Can anyone tell me what i can change this code to to make sure it always rounds up to the next number. Link to comment https://forums.phpfreaks.com/topic/99420-ceil/ Share on other sites More sharing options...
discomatt Posted April 3, 2008 Share Posted April 3, 2008 Try a quick debug. echo $this->total_rows . ' / ' . $this->rows_per_page . ' = ' . $this->total_rows/$this->rows_per_page . ' ceil'd ' . ceil($this->total_rows/$this->rows_per_page) . '<br>'; $this->max_pages = ceil($this->total_rows/$this->rows_per_page); echo $this->max_pages; Link to comment https://forums.phpfreaks.com/topic/99420-ceil/#findComment-508773 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.