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? 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. Link to comment https://forums.phpfreaks.com/topic/140525-multiple-where-statement/#findComment-735384 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.