I am creating a site with admins that are allowed to delete a user if the users accesslevel is less than 8. I tried this as well as a few other solutions, but it doesn't work. How should I be going about this? @id is defined previously in the same code, but is not the error. It is entered by the user.
SET @hi = SELECT IF(SELECT accesslevel FROM members WHERE id = 8 < @id, 1,0);
IF @hi == 1 THEN {DELETE FROM members WHERE id = @id}
END IF;
Thank you for any help.
Completely spaced AND. Changed it to:
DELETE FROM members WHERE id = @id AND accesslevel < 8;
Code works as needed now.