We have a load of products and want to show best sellers from the category a product is it.
ie. if you sell cars, and you are hundreds of Fords. You want to show a particular Ford page, but then show all your best selling fords.
What if you run out of Fords? You want to then also maybe show Jaguar's or ANY OTHER cars in your Lot.. So your query is a randomly selected query for about 16 items, firstly looking for those Fords in the system, but if you only have 4 Fords, it then finds ANY (*) other products randomly.
Code: Select all
$result = mysql_query ("SELECT * FROM products WHERE best = 'yes' AND pause = 'off' AND photoprimary IS NOT NULL ORDER BY RAND() LIMIT 0, 12");