I am trying to use the block list so members that have blocked other members do not show up.
SELECT `ID` FROM `Profiles` WHERE `Status` = 'Active' AND
`DateLastNav` > SUBDATE(NOW(), INTERVAL 1 MINUTE) AND `ID` <> 226 AND `Avatar` <> 0 AND `Profiles`.`allow_view_to` = '3' OR `Profiles`.`allow_view_to` = '1' AND NOT (SELECT COUNT(*) FROM `sys_block_list`,`Profiles` WHERE `Profiles`.`ID` = `sys_block_list`.`ID` AND `sys_block_list`.`Profile` = '226') LIMIT 28
This should NOT return values where user 226 is in their block list, however it does.
SELECT COUNT(*) FROM `sys_block_list`,`Profiles` WHERE `Profiles`.`ID` = `sys_block_list`.`ID` AND `sys_block_list`.`Profile` = '226'
If I run this query, I get a 1 (which there is only 1 person blocking 226).
Any database gurus out there know what I am doing wrong?
Thanks!