CodeIgniter Forums
Pagination Total Row Count - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Pagination Total Row Count (/showthread.php?tid=5424)



Pagination Total Row Count - El Forum - 01-21-2008

[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?


Pagination Total Row Count - El Forum - 01-21-2008

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


Pagination Total Row Count - El Forum - 01-21-2008

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