I'm creating an e-commerce engine where the info is pulled from a db. When you click on a catagory, it takes you to a list of products related to that catagory. However, if there is just one product associated with the catagory, I want it to take the user directly to that product description, rather than a list of one, kwim?
How do I count the number of products so that if there is just one, it creates a link to a detail page, and if there is more than one, it creates a link for a list page? I keep ending up with a loop that prints a link for each product related to that catagory!!
Thx!