Author Topic: Pagination using multiple searcing criteria in codeigniter  (Read 326 times)

0 Members and 1 Guest are viewing this topic.

Offline gun41exeTopic starter

  • Irregular
    • View Profile
Pagination using multiple searcing criteria in codeigniter
« on: January 21, 2010, 09:49:05 AM »
Hi ..., Im trying to implement pagination using multiple searching criteria.
Supposed I Have student table. I also use pagination when the list of student displayed.
The pagination link is. `site_url . '/student/page/';` so I use `$config['uri_segment'] = 1`;
so the pagination link will be

   
Code: [Select]
<a href="http://mysite/index.php/student/page/0">1</a>
    <a href="http://mysite/index.php/student/page/1">2</a>

and son.


After that I wanna search student data using 3 searching criteria implemented using textfield.

   
Code: [Select]
id name address.
user can search by id or name or address or combination of the three criteria.
the url become

   
Code: [Select]
http://mysite/index.php/student/page/0
    href=http://mysite/index.php/student/page/1

and son.

but  I use get method for searching.  and while trying to search using the search criteria field the url become

   
Code: [Select]
href="http://mysite/index.php/student/page/1?id=1&name=a&address=b
the problem occurred when I try create pagination based on criteria. because the pagination link have contain query string
i don't know how to create become

   
Code: [Select]
href="http://mysite/index.php/student/page/0?id=1&name=a&address=b
    href="http://mysite/index.php/student/page/1?id=1&name=a&address=b

or do you have a best practice to solve this problem ?

Online JAY6390

  • Enthusiast
  • Gender: Male
  • Not suitable for adults
    • View Profile
    • Jay Gilford
Re: Pagination using multiple searcing criteria in codeigniter
« Reply #1 on: January 21, 2010, 10:43:17 AM »
Wouldn't the segment be 3 not 1?

Offline gun41exeTopic starter

  • Irregular
    • View Profile
Re: Pagination using multiple searcing criteria in codeigniter
« Reply #2 on: January 21, 2010, 10:53:16 AM »
Wouldn't the segment be 3 not 1?


upss .., sory. It should be 3. thanks for correction.

PHP Freaks Forums

« on: »

Tired of these ads? Purchase a supporter subscription to get rid of them.