Welcome Guest, Not a member yet? Register   Sign In
single result from multiple
#1

[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? Smile

Any thoughts or impressions would be greatly appreciated.

Thanks


Messages In This Thread
single result from multiple - by El Forum - 06-14-2009, 09:46 AM
single result from multiple - by El Forum - 06-14-2009, 10:21 AM
single result from multiple - by El Forum - 06-14-2009, 07:39 PM
single result from multiple - by El Forum - 06-15-2009, 11:41 AM



Theme © iAndrew 2016 - Forum software by © MyBB