A client has requested that I add next and previous buttons to their website catalog but Im not sure what the best method is to make this happen.
My biggest problem is that there is a products table with all the products and there is multiple categories to group the products.
Some how I need to query the data for a selected category, determine what product the user is currently looking at and then pull out the previous entry and next entry. I would like to use the productid field but since the categories may not be grouped together in the database its not as simple as moving to the next record
First idea: query the database of a category into an array, determine what product the user is on and move back one and forward one with in the array.
Second idea: Determine what product the user is looking at and then search for the next and previous record displaying the 2 closest.
Im not sure how either one of these ideas would be coded or if it is even the right way of doing something like this.
Any ideas?