[PHP] I would like to display a list of the same products only if productPublic = staff or members.

2003-01-31 Thread Philip J. Newman
I would like to list 2 possable items in a mysql queary.

SELECT * FROM products WHERE productType = '$productType AND Where
productPublic = 'staff' OR productPublic = 'members' ORDER BY productId DESC
LIMIT 10

I would like to display a list of the same products only if productPublic =
staff or members.

At the moment what i have just gives me the 1st 10 items.

Any help





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] I would like to display a list of the same products only if productPublic = staff or members.

2003-01-31 Thread Tom Rogers
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 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


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php