I have problems writing a SP in MySQL. From what I can read on the net the following should work, but it does not. I use Mysql v. 5.1.35
CREATE DEFINER=`My_Username`@`%` PROCEDURE `ChangePassword`(IN SPusername VARCHAR(100),
IN SPoldPassword VARCHAR(100),
IN SPnewPassword VARCHAR(100))
BEGIN
IF EXISTS(SELECT Password_Hash
FROM Customer
WHERE SPusername = Email
AND SPoldPassword = Password_Hashed)
THEN
UPDATE Customer
SET Password_Hashed = SPnewPassword
END IF;
END;