Microsoft SQL Server 2000 pagination with CI - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Microsoft SQL Server 2000 pagination with CI (/showthread.php?tid=25728) |
Microsoft SQL Server 2000 pagination with CI - El Forum - 12-22-2009 [eluser]praxedis[/eluser] 1. If you're running Microsoft SQL Server 2000, I feel for you. I only had to deal with this because my day job is dumb enough to be running virtually all its legacy stuff on SQL Server. 2. Stored procedures WILL NOT WORK with active record in CI. If you've written a fancy stored procedure to take care of pagination in SQL Server 2000, congratulations, but it's useless for anyone developing in CI. 3. This tutorial is only for those running SQL Server 2000. SQL Server 2005 has fancy functions like ROW_NUMBER() that make it a little easier to do the pagination. 4. Make sure you add 'pagination' to the list of libraries in your config/autoload.php file or call it up in your controller. Here we go: I have a table called 'people_table' that stores person information: person_id person_first_name person_last_name person_email In my model, I have these functions. Code: function get_all_people() { In my controller, I have: Code: function index() { And there you have it. Don't forget that auto_link() is a CI URL helper. Main difference here is obviously the SQL for pagination. There is no other way than using TOP/TOP for SQL Server 2000. Hope this helps. |