Will probably always be false, user->data['user_id'] is usually a string. use (int) user->data['user_id']