Welcome Guest, Not a member yet? Register   Sign In
count_all_results
#1

[eluser]Mitja[/eluser]
Code:
$this->load->library('pagination');
            $config['base_url'] = base_url().'happening/arrangements';
            $this->db->query("SELECT * from arrangement_event WHERE $searcharg");
            $config['total_rows'] = $this->db->count_all_results();
            $config['per_page'] = '3';
            $this->db->limit($config['per_page'], $this->uri->segment(3));
            
            $query = $this->db->query("SELECT * from arrangement_event WHERE $searcharg LIMIT 3");
            $data['search'] = $query;
            $this->pagination->initialize($config);

why count_all_results not working.

This code does not work

Code:
$this->db->query("SELECT * from arrangement_event WHERE $searcharg");
$config['total_rows'] = $this->db->count_all_results();

can i call $this->db->query after $this->db->count_all_results();

thx
#2

[eluser]Armchair Samurai[/eluser]
count_all_results() only works with Active Record according to the user guide




Theme © iAndrew 2016 - Forum software by © MyBB