Procedure in MySQL
-
Hallo,
ich hab da mal was geschrieben, aber irgendwie will mysql 5.1 den Code nicht annehmen. was hab ich da falsch gemacht?Grüße Noq
DELIMITER // CREATE PROCEDURE spLogin (IN pName VARCHAR(30), IN pPassword VARCHAR(128), OUT isvalid INT) SQL SECURITY INVOKER BEGIN DECLARE tid INT DEFAULT 0; DECLARE tbanned TINYINT; SELECT id, banned FROM accounts WHERE name = pName AND password = pPassword INTO tid, tbanned; IF tid > 0 THEN IF tbanned = 1 THEN tid = -1; END; END; isvalid = tid; END // DELIMITER;