title: mysql stored procedure login
body: <p>I am using mysql and have a procedure for login authentication, </p>
  
  <pre><code>    CREATE PROCEDURE CheckPassword (IN username CHAR(8),IN password_p VARCHAR(20), OUT yes_no char(1))
      BEGIN
      IF EXISTS(SELECT * FROM USER WHERE USER_ID = username AND password = password_p) then
          set yes_no = '0';
      ELSE
           set yes_no = '1';
      END IF;
      END;
  </code></pre>
  
  <p>But it mysql warned that having error when creatinng the procedure, it say have the error i nfor line 4, it is the line of "set yes_no = '0';"? I have try this way too,</p>
  
  <pre><code>    CREATE PROCEDURE CheckPassword (IN username CHAR(8),IN password_p VARCHAR(20), OUT yes_no char(1))
      BEGIN
      IF EXISTS(SELECT * FROM USER WHERE USER_ID = username AND password = password_p) then
          select '0' into yes_no;
      ELSE
           select '1' into yes_no;
      END IF;
      END;
  </code></pre>
  
  <p>Didn't work too, is that a must to use delimeter when create procedure? and can u tell me statement of calling this procedure, </p>