Good time of the day, I have my own procedure, which should receive the oldest entry and update the date of access to this entry, when calling
mysql> CALL User ();
Query OK, 1 row affected (0.06 sec)
It will always return OK. I understand this because the result of the UPDATE function is returned. If you remove the UPDATE query, then the normal result is returned as it should be ...
Actually the question is how to leave UPDATE but what would the procedure return the result of the work select?
CREATE DEFINER=`h`@`%` PROCEDURE `User`() BEGIN SELECT userP.id, userP.username, INTO @id, @username, FROM `User` ORDER BY DateUse ASC limit 1; UPDATE `User` SET DateUse=CURRENT_TIMESTAMP WHERE id=@id; END