title: Mysql function, return more than one row
body: <p>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.</p>
  
  <pre><code>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 &lt;= now() and valid_to &gt; now() THEN
  RETURN TRUE;
  ELSE
  RETURN FALSE;
  END if;
  
  END
  </code></pre>
  
  <p>if i want to proceed this function i get the error message: Result consisted of more than one row.</p>