You are here:  » Featured Random


Featured Random

Submitted by Eddie on Mon, 2006-11-13 15:52 in

David,

I get the $sql = "SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 3"; shows 3 products and I get the feature.php file.

What I wan to get is 9 RANDOM products in the same format as on www.shopsort.co.uk. At the moment I get 3 rows of the same!

Eddie

Submitted by support on Mon, 2006-11-13 17:25

Hi Eddie,

I'm not sure how you're ending up with 3 rows of the same, but to do this, first set the LIMIT to 9 in the SQL so that you have:

$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 9";

Then, you need to add code to html/featured.php in order to generate a table and display a new line every 3 products. The code for that is in this thread:

http://www.pricetapestry.com/node/284

Cheers,
David.