Witam, mam model:
  1. function get_numer_of_cyte_by_author($link)
  2. {
  3.  
  4. $query = $this->db->query("SELECT `tresc` FROM `cytaty` where `artysta` = '$link' and `status` = 1");
  5.  
  6. return $query->num_rows();
  7.  
  8. }
  9.  
  10. function getSearchResults($kogo, $perpage, $to)
  11. {
  12.  
  13. $query = $this->db->query("select * from `cytaty` where `artysta` = '$kogo' and `status` = 1 limit $to, $perpage");
  14.  
  15.  
  16. $lis = $query ->result();
  17.  
  18. return $lis;
  19.  
  20. }


Kontroler:

  1. function pokaz($kogo)
  2.  
  3. {
  4. $this->load->model('cytat');
  5. $this->load->library('pagination');
  6. $tekst['artysci'] = $this->cytat->get_artists();
  7. $tekst['users'] = $this->cytat->get_users();
  8.  
  9. $config['base_url'] = site_url().'/cytaty/pokaz/'.$kogo.'';
  10. $config['total_rows'] = $this->cytat->get_numer_of_cyte_by_author($kogo);
  11. $config['per_page'] = '2';
  12.  
  13. $this->pagination->initialize($config);
  14.  
  15. $tekst['imie'] = $this->cytat->get_artist_name($kogo);
  16.  
  17. //$tekst['dane'] = $this->cytat->get_cyte_by_author($kogo);
  18.  
  19. if(!$this->uri->segment(4))
  20. $lol = 0;
  21. else
  22. $lol = $this->uri->segment(4);
  23.  
  24. $tekst['dane'] = $this->cytat->getSearchResults($kogo, $config['per_page'], $lol);
  25. $this->load->view('pokaz-cytaty', $tekst);
  26. }


I widok:

  1. <?
  2.  
  3. foreach($dane as $dana)
  4. {
  5.  
  6. echo $dana->tresc;
  7.  
  8. }
  9.  
  10. ?>
  11.  
  12.  
  13.  
  14. <?
  15. echo $this->pagination->create_links();
  16. ?>



Dostaję owe 2 rekordy.. Oraz paginację. Lecz gdy przejdę do 2 strony, to nadal pogrubiona jest strona 1, i nie mogę wrócić do 1 strony, prócz rzecz jasna wstecz w przeglądarce.. Rekordy podawane są prawidłowo.

Proszę o pomoc smile.gif
PS. Już działa! Dodałem do configa $config['uri_segment'] = '4'; i działa smile.gif