I have build a little mysq function who should check is the users in my table are still vaid, the have got a row validfrom and validto and my function should check if the validto date is older than now.
CREATE DEFINER=`root`@`localhost` FUNCTION `is_valid_user`(username
VARCHAR(10)) RETURNS tinyint(1)
BEGIN
DECLARE valid_from, valid_to datetime;
SELECT
Gültig_von, Gültig_bis
INTO valid_from , valid_to FROM
Benutzer
WHERE
Benutzername = username;
IF valid_from <= now() and valid_to > now() THEN
RETURN TRUE;
ELSE
RETURN FALSE;
END if;
END
if i want to proceed this function i get the error message: Result consisted of more than one row.