$query = mysql_query("SELECT * FROM `notifications` WHERE `npoints` > 0 AND `to` = 1 OR `from` = 1"); return mysql_num_rows($query);
does not respond to npoints > 0
0 AND `to` = 1 OR `from` = 1"); return...">
I suspect that you would like this:
SELECT * FROM `notifications` WHERE `npoints` > 0 AND (`to` = 1 OR `from` = 1)
Please note, I added brackets to the condition!
Source: https://ru.stackoverflow.com/questions/166107/
All Articles