Hi John, I think you missed on the precedence of AND/OR if you change to > AND (cat_id='2' OR cat_id='5' ) it should work as you want it to
/Johan John Croson wrote:
I have a simple query:
SELECT id,year,month,day,cat_id FROM events LEFT JOIN calendar_cat ON events.cat=calendar_cat.cat_id WHERE year>=YEAR(CURDATE()) AND month>=MONTH(CURDATE()) AND day>=DAYOFMONTH(CURDATE()) AND cat_id='2' OR cat_id='5' AND approved='1' ORDER BY year,month,day ASC
-- Johan H��k, Facility Engineering Group - MailTo:[EMAIL PROTECTED] - http://www.pythagoras.se Pythagoras AB, Stormbyv. 2-4, SE-163 55 SP�NGA, Sweden Phone: +46 8 760 00 10 Fax: +46 8 761 22 77
-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]
