Welcome Guest, Not a member yet? Register   Sign In
Pagination Total Row Count
#1

[eluser]Kemik[/eluser]
Hello all,

I'm copying some pagination code from a previous project to my new one. The old project uses the current stable CI version whereas the new one uses the latest SVN version.

Here's the code and error:

Code:
// Load pagination class
        $this->load->library('pagination');
        $config['base_url'] = base_url().'admin/users/';
        $config['total_rows'] = $this->db->count_all('users');
        $config['per_page'] = '20';
        $config['full_tag_open'] = '<p>';
        $config['full_tag_close'] = '</p>';
        $config['uri_segment'] = 4;
        
        $this->pagination->initialize($config);

Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM `users`' at line 1

SELECT COUNT(*) AS FROM `users`

The users table does exist. Any ideas?
#2

[eluser]Derek Allard[/eluser]
Grab another new copy of the database folder. I fixed up a bug that this sounds suspiciously similar to.
#3

[eluser]Kemik[/eluser]
Worked. Thanks.




Theme © iAndrew 2016 - Forum software by © MyBB