Re: I would like to display a list of the same products only if productPublic = staff or members.
| From: | Tom Rogers | Date: | Sat, 01 Feb 2003 04:13:27 +0000 |
| Subject: | Re: I would like to display a list of the same products only if productPublic = staff or members. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-133847@lists.php.net to get a copy of this message | ||
Hi,
Saturday, February 1, 2003, 2:00:51 PM, you wrote:
PJN> I would like to list 2 possable items in a mysql queary.
PJN> SELECT * FROM products WHERE productType = '$productType AND Where
PJN> productPublic = 'staff' OR productPublic = 'members' ORDER BY productId
PJN> DESC
PJN> LIMIT 10
PJN> I would like to display a list of the same products only if productPublic =
PJN> staff or members.
PJN> At the moment what i have just gives me the 1st 10 items.
PJN> Any help
you need brackets to sort out the logic
SELECT *
FROM products
WHERE productType = '$productType AND (productPublic = 'staff' OR productPublic =
'members')
ORDER BY productId DESC
LIMIT 10
--
regards,
Tom