Basic Pagination Help? - 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: Basic Pagination Help? (/showthread.php?tid=31838) |
Basic Pagination Help? - El Forum - 07-03-2010 [eluser]Corey Freeman[/eluser] Sorry if I'm such a newb...I finally figured out models and am attempting to paginate a list of players for my browser game. This is what I ended up with for my controller: Code: <?php (there are only two players in the database, that's why the number of results is so low.) I end up with a 404 error when I click the next button. Help? Basic Pagination Help? - El Forum - 07-03-2010 [eluser]umefarooq[/eluser] hi just found what's the problem in you code your base_url for controller function is wrong Code: change it to Basic Pagination Help? - El Forum - 07-04-2010 [eluser]Corey Freeman[/eluser] [quote author="umefarooq" date="1278235661"]hi just found what's the problem in you code your base_url for controller function is wrong Code: change it to You're my hero. I feel like a complete moron now >.> Basic Pagination Help? - El Forum - 07-04-2010 [eluser]Corey Freeman[/eluser] Okay for some reason I can't figure out why it won't let me order them... Code: function list_players() { Basic Pagination Help? - El Forum - 07-04-2010 [eluser]umefarooq[/eluser] for this you have to check your query CI active record preparing correct query or not print your query using $this->db->last_query(); Code: after this line where you want to sort your result here $data['players'] = $this->players_model->get_players($per_page, $this->uri->segment(3)); or here $data['query'] = $this->db->get('players'); |