title: Can't create stored procedure: Syntax error
body: <p>I want to make a procedure that will insert user in table, but it should also check if user is 18 years old. I'm "doing" it with an <code>if</code> statement (<code>p_datum_rodjenja</code> is birth date of user). I'm not sure if my logic works because I cant create this procedure: when I try to run the query I got the following error:</p>
  
  <blockquote>
    <p>Syntax error. Error code:1064.</p>
  </blockquote>
  
  <p>Here is my code:</p>
  
  <pre><code>delimiter #
  create  procedure dodajKorisnikaProvjera
  (
      IN p_ime varchar(15),
      IN p_prezime varchar(15),
      IN p_broj_telefona int,
      IN p_datum_rodjenja date,
      IN p_broj_vozacke int,
      IN p_grad_id int
  )
  BEGIN
  
  if(TIMESTAMPDIFF(p_datum_rodjenja,CURDATE()) &gt;18) then
  
      INSERT into korisnik(
      ime,
      prezime,
      broj_telefona,
      datum_rodjenja,
      broj_vozacke,
      grad_id)
       VALUES(
      p_ime,
      p_prezime,
      p_broj_telefona,
      p_datum_rodjenja,
      p_broj_vozacke,
      p_grad_id
      );
      else
      select'Korisnik mora imati vise od 18 godina.';
      end if;
  
  END#
  delimiter;
  </code></pre>