title: Mysql Function returns Null always
body: <p>I have a function in mysql like below: </p>
  
  <pre><code>DELIMITER $$ 
  
  CREATE DEFINER=root@localhost FUNCTION fnGetDropDownValue(
      itemValue varchar(300), 
      DropDownId int, 
      CId int
  ) RETURNS int(11)
  BEGIN
      DECLARE listId int;
      SELECT ListID into listId FROM DropDownListValues WHERE LOWER(ListValue) = LOWER(itemValue) AND DropDownListID = DropDownId AND (ClientId = 0 OR ClientId = CId);
      RETURN listId;
  END$$
  </code></pre>
  
  <p><br />
  But it always returns Null values when I use <br />
  <code>SELECT fnGetDropDownValue('General', 24, 18);</code>
  I don't know what I am doing wrong :(</p>