Hi David,
I use the code provided from you for random featured productsd, but I want to restrict the results to only 1 of 2 merchants. How can I manage that?
Regards
Roland
David,
I use that one you provided earlier:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` ORDER BY RAND() LIMIT 5";
Roland
Hi Roland,
This code picks from the featured products table which does not contain merchant information. Were you actually looking to pick products from your entire database, but only one merchant?
That could be done by using something like this - note that it SELECT's from the products table instead of featured:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE merchant='Merchant1' ORDER BY RAND() LIMIT 5";
If you want to select from more than one merchant, do something like this:
$sql = "SELECT * FROM `".$config_databaseTablePrefix."products` WHERE (merchant='Merchant1' OR merchant='Merchant2') ORDER BY RAND() LIMIT 5";
Hope this helps,
Cheers,
David.
Hi Roland,
Can you post the SQL that you are using at the moment (your line that says $sql = "....") and I will modify it for you to select from only one merchant....
Cheers,
David.