[eluser]Unknown[/eluser]
I am writing a product display page that displays the selected product in detail as well as displaying the rest of the available products as a list of links.
Initially I wrote two SQL queries to accomplish this and that worked fine to a point. But here is where I ran into trouble. For each product displayed I am also providing a previous and a next button as another navigation option. Because the products are separated into categories the database index does not create an accurate numerical incrementing of products.
I am thinking of getting all of the items form a specific category and then loop through the results to find the matching product_id I would like as the main display piece. This would give me access to:
Code:
$row = $query->next_row()
$row = $query->previous_row()
So my question is: Is this the correct/best way to go about this? Is their a more efficient way? Is "I can't believe it's not butter" really not butter?
Any thoughts or impressions would be greatly appreciated.
Thanks