wmguk Posted January 12, 2009 Share Posted January 12, 2009 I'm trying to run an SQL WHERE touser is $username OR 'all' but I'm doing the other && too, so im not sure how to word the qry? $sqltodo="SELECT * FROM notifications WHERE touser='$username' && MONTH(timedate)='$month' && DAY(timedate)='$day'"; any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/140525-multiple-where-statement/ Share on other sites More sharing options...
premiso Posted January 12, 2009 Share Posted January 12, 2009 Use parenthesis to group it, just like math. Order of Operations. So if (x and x) OR (x and y) return the results. Quote Link to comment https://forums.phpfreaks.com/topic/140525-multiple-where-statement/#findComment-735384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.