Welcome Guest, Not a member yet? Register   Sign In
$config['use_page_numbers'] = TRUE is not working perfectly in codeigniter 2.1.0?
#1

[eluser]somenet[/eluser]
How to solved this problem?
#2

[eluser]pbflash[/eluser]
You need to describe your problem in order for anyone to even try to help fix it.
#3

[eluser]somenet[/eluser]
I mean there is no actual data is return while using $config['use_page_numbers'] while using pagination class in codeigniter 2.1.0.How to solve this problem.
#4

[eluser]TWP Marketing[/eluser]
So, show us what you have tried and what output you did get. Your question is still unclear. Yes, we get that something doesn't work as you expect, but be more specific please. Show your code (use the [ code] tags please).
#5

[eluser]somenet[/eluser]
Code:
<?php
class Books extends CI_Controller {
  function __construct() {
    parent::__construct();
  }

  function index() {
    // load pagination class
    $this->load->library('pagination');
    $config['base_url'] = base_url().'books/index/';
    $config['total_rows'] = $this->db->count_all('book');
    $config['use_page_numbers'] = TRUE;
    $config['per_page'] = '1';
    $config['full_tag_open'] = '<p>';
    $config['full_tag_close'] = '</p>';

    $this->pagination->initialize($config);
    $data['results'] = $this->db->get('book',$config['per_page'],$this->uri->segment(3));
  
    // load the HTML Table Class
    $this->load->library('table');
    $this->table->set_heading('BookId', 'Bookname', 'Price', 'Author');
  
    // load the view
    $this->load->view('books_view', $data);
  }
}
when i fetch data in view file it does not return all data from the database as well as actual data also.And my view file is like this
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
&lt;html xml:lang="en-us" lang="en-us"&gt;
&lt;head&gt;
&lt;meta http-equiv="content-type" content="text/html; charset=utf-8" /&gt;
&lt;link rel="stylesheet" href='&lt;?php echo base_url(); ?&gt;css/main.css' type="text/css" media="screen, projection" /&gt;
&lt;title&gt;CodeIgniter Pagination Tutorial&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
<h1>Padam Books</h1>
&lt;?php echo $this->table->generate($results); ?&gt;
&lt;?php echo $this->pagination->create_links(); ?&gt;
&lt;/body&gt;
&lt;/html&gt;
#6

[eluser]TWP Marketing[/eluser]
[quote author="somenet" date="1337560562"]
Code:
&lt;?php
class Books extends CI_Controller {
...
  function index() {
    // load pagination class
...
    $data['results'] =
$this->db->get('book',$config['per_page'],$this->uri->segment(3));
...
    $this->load->view('books_view', $data);
  }
}
when i fetch data in view file it does not return all data from the database as
well as actual data also.And my view file is like this
[/quote]

In your controller, you pass the limit and offset using the get() method. That
will limit the data you get back from the query. Are you sure the correct limit
and offset are passed? What is the full url used to call your page? Is segment 3
(the offset) correct?
#7

[eluser]somenet[/eluser]
yes i passed the actual limit and offset.The url is like this http://localhost/CodeIgniter_2.1.0/books/index/ but this code is true while $config[’use_page_numbers’] = false is used,only when we use $config[’use_page_numbers’] = true then this time it not return actual data.




Theme © iAndrew 2016 - Forum software by © MyBB