Hi guys.
I'm just wondering why this function always returns true, no matter what the $user_id is. The $user_id variable is determined by what is retreived from the $_SESSION.
I am well aware that mysql_* functions are being depreceated etc, no need to tell me :P
Thanks guys!
function user_mod() {
$user_id = $_SESSION['user_id'];
return (mysql_result(mysql_query("SELECT COUNT($user_id) FROM `users` WHERE `permissions` = 1 OR `permissions` = 2"), 0) == 1) ? true : false;
}