Welcome Guest, Not a member yet? Register   Sign In
[SOLVED]Pagination Problem!
#11

[eluser]husni[/eluser]
not yet..
still static on the page 1 even though i clicked number 2..
#12

[eluser]maria clara[/eluser]
try to change this line in your controller

Code:
if (isset($page) && is_int($page))

to

Code:
if (isset($page) && is_numeric($page))
#13

[eluser]husni[/eluser]
it's still the same..
i don't know what is the problem actually.
what is the function of this one??
do i need to echo the query??
Code:
$data['query'] = $this->Helpdesk_model->getAllReport(5,$offset);
#14

[eluser]maria clara[/eluser]
[quote author="husni" date="1264672178"]it's still the same..
i don't know what is the problem actually.
what is the function of this one??
do i need to echo the query??
Code:
$data['query'] = $this->Helpdesk_model->getAllReport(5,$offset);
[/quote]

what's now happening in your pages??
this
Code:
$data['query'] = $this->Helpdesk_model->getAllReport(5,$offset);
calls the function getAllReport()

this time your pagination should be the uri is getting pull and querying the database correctly. what happens now with your links?? is it incrementing now?
#15

[eluser]husni[/eluser]
still display the same thing..
the link is incremented already..
but when i click to go to the second set of data..it still in the first set of data..
what's going on huhu...
#16

[eluser]husni[/eluser]
Code:
function getAllReport($num = NULL, $offset = NULL)
    {
        $query=$this->db->get('tblreport');
        $query = $this->db->query("SELECT * FROM tblreport  ORDER BY report_id ASC LIMIT $offset, $num");    
        return $query;
        //WHERE end >= NOW()
    }

just changed the code a little bit in the model..
#17

[eluser]maria clara[/eluser]
the pagination is giving you an offset instead of a page number...try to change

Code:
$offset = ($page-1) * $config['per_page'];

to

Code:
$offset = $page;

and let us see what will now happen..
#18

[eluser]husni[/eluser]
erhhh..
still the same??!!
any other solutions?
huhu

i have 10 reports..
but it only display 5 of them..
#19

[eluser]husni[/eluser]
Quote:http://www.devshed.com/c/a/PHP/Paginatin...Framework/

this is the link to the source code where i got the code for my pagination..
#20

[eluser]maria clara[/eluser]
i don't know what's happening in your pagination..i'll try to read your link of where you got your code for that..




Theme © iAndrew 2016 - Forum software by © MyBB