I\'ve been trying to find an answer to this question, but haven\'t found any definitive \"yes\" or \"no\" in all my research.
I\'m running a simple MySQL query like
If you don't want to run another Query SELECT then here is another way to do it. I have modified Mr. Berkowski code for reference:
DELIMITER $$
CREATE PROCEDURE increment_score
(
IN id_in INT
)
BEGIN
set @newScore := null;
UPDATE item SET score = IF((@newScore := score+1) <> NULL IS NULL, @newScore, NULL) WHERE id = id_in;
SELECT @newScore;
END
DELIMITER ;