Here is my PROCEDURE:
CREATE DEFINER=`root`@`localhost` PROCEDURE `user_active_account`(IN i_email VARCHAR(255),
IN i_active_code VARCHAR(255))
BEGIN
START TRANSACTION;
DELETE FROM activeCodes WHERE active_code = i_active_code;
UPDATE users SET status = 1 WHERE email = i_email;
COMMIT;
END
I got a problem here, I would like to execute DELETE FROM activeCodes WHERE active_code = i_active_code success, if this line cannot run success (For example, it can’t delete any things), the UPDATE users SET status = 1 WHERE email = i_email can not be executed. How can I focus this behaviour? Thanks.
check mysql_affected_rows. if greater than 0, then there definitely has been a delete. Hope that helps