Login   Register  
PHP Classes
elePHPant
Icontem

Great job but...

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us

      A simple pagination using MySQL  >  All threads  >  Great job but...  >  (Un) Subscribe thread alerts  
Subject:Great job but...
Summary:$_GET['page'] error when 1st time access
Messages:1
Author:Maloteau
Date:2009-07-27 23:18:19
 

  1. Great job but...   Reply   Report abuse  
Picture of Maloteau
Maloteau
2009-07-27 23:18:19
Hi,

Maybe I'm wrong but when you access for the first time to the page, your $_GET['page'] is not set that's why you have an error with this code :

elseif($_GET['page']>$this->pages) {
$start = $this->pages;
$end = $this->resultPerPage;
$this->query.= " LIMIT $start,$end";

To fix this, I add an isset :
elseif(isset($_GET['page'])>$this->pages) {
...

I have not tested the class with our example, I met this error perhaps because I've adapted the class to my controller class :)

Thanks for the code by the way :)