I have a list of products in which when I press on a subcategory, it loads all of its products in that subcategory and uses the index as:
http://localhost/ClickBasket/listproductscontroller/index?subcategory=4
Since it could contain a lot of products, I used CI's pagination library. It works well when I go to the second or third pages:
http://localhost/ClickBasket/listproductscontroller/index/1?subcategory=4
http://localhost/ClickBasket/listproductscontroller/index/2?subcategory=4
But when I return to the first page, it would lose the subcategory's id:
http://localhost/ClickBasket/listproductscontroller/index
As such, the data of the subcategory and its product in the page could not be found. How do you fix this? I am still learning about the pagination library of CodeIgniter.