it will always return true, because of your where clause
WHERE `permissions` = 1 OR `permissions` = 2"
if there is nothing to count in user_id, then your codes above will return how many members with permission 1 and permission 2. Thus, your script above will literally return the entire count for perm 1 and perm 2.
You can add AND matching only the user_id,, but I am not sure if this is what you are trying to do..
Something like this..
("SELECT COUNT($user_id) FROM `users` WHERE user_id = '".$user_id."' AND `permissions` = 1 OR `permissions` = 2"), 0)
That should return either 0 or the total count of members with the same user ID and with either permission 1 or permission 2..