I have no working experience in MySQL but i've tried to convert your MS SQL Server stored procedure into a MYSQL stored procedure. Please checkout the following code
Code:
CREATE PROCEDURE account_Login (IN ScrName VARCHAR(50),IN Passwd AS VARCHAR(50) )
BEGIN
DECLARE GoodLogin INT
SELECT UserID INTO GoodLogin FROM Users WHERE ScreenName = ScrName AND Password = Passwd AND Status <> 0;
IF GoodLogin IS NOT NULL THEN
UPDATE Users SET LastLogin = CURDATE() WHERE UserID = GoodLogin;
END IF;
SELECT * FROM Users WHERE ScreenName = ScrName AND Password = Passwd AND Status <> 0;
END
Just to avoid the confusion i've used different names for the variables inside the procedure and the table columns.
Bookmarks