There is a mysql query:
mysql_query(" SELECT * FROM notifications INNER JOIN users u1 ON u1.vk_id = notifications.from INNER JOIN users u2 ON u2.vk_id = notifications.to WHERE notifications.npoints > 0 AND notifications.history = 1 AND (notifications.to = 1 OR notifications.from = 1) ORDER BY notifications.id DESC LIMIT 5 ");
Does not respond to this line. Always pays attention only to from. Although it is written: to or from:
notifications.to = 1 OR notifications.from = 1