wmguk Posted April 20, 2009 Share Posted April 20, 2009 hey, I have a simple qry. display everything in the notifications table, where the touser is either the username or "ALL" and the date is today.... I'm using: $time = time(); $day = date('j', $time); $month = date('m', $time); $todosql = "SELECT * FROM notifications WHERE MONTH(timedate)='$month' && DAY(timedate)='$day' AND touser='$username' || touser = 'all'"; $todoresult = mysql_query($todosql); while ($row = mysql_fetch_array($todoresult)) { however if my username is Drew, i see the results for Andrew too... any ideas? Link to comment https://forums.phpfreaks.com/topic/154876-my-qry-produces-like-results/ Share on other sites More sharing options...
Mchl Posted April 20, 2009 Share Posted April 20, 2009 Put parentheses around (touser='$username' || touser = 'all') Link to comment https://forums.phpfreaks.com/topic/154876-my-qry-produces-like-results/#findComment-814551 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.