feri_soft Posted October 27, 2007 Share Posted October 27, 2007 Hi all, I am using Codeigniter here but thats not the problem 100% i just need some php/mysql advice. I have a recursive function for getting all products in the cat and in its subcats and its working fine: function getAllProducts($catID, $limit, $offset){ $query = $this->db->getwhere('products',array('category' => $catID), $limit, $offset); if($query->num_rows() > 0){ foreach($query->result_array() as $product){ $this->products[] = $product; } } if($this->getSubCats($catID)){ foreach ($this->getSubCats($catID) as $subcat) { $this->getAllProducts($subcat['id'], $limit, $offset); } } return $this->products; } Now i can put the total_results, the url and so on in the pagination config, but when i try to manipulate the limit and offset in this function i get errors. $this->db->getAllproducts($cat_info['$id'], $config['per_page'], $this->uri->segment(3)); How am i supposed to change the function so that the correct articles are get. Now i get all on the first page and nothing on the rest... uri->segment is identical to $_GET[].... in a way Link to comment https://forums.phpfreaks.com/topic/74995-pagination-problem/ Share on other sites More sharing options...
feri_soft Posted October 27, 2007 Author Share Posted October 27, 2007 Any suggestions? Link to comment https://forums.phpfreaks.com/topic/74995-pagination-problem/#findComment-379417 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.