$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

    1 answer 1

    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!

    • Damn, beat)) - Sh4dow
    • four
      From my answer I will add that AND has a higher priority, therefore it is not grouped as it should be @ModaL - Sh4dow
    • @Pavel Vershinin, merci :) - ModaL