title: Stored procedure MYSQL error
body: <p>Having a few issues with running the below procedure over PHPMyAdmin, receiving the error;</p>
  
  <p>"1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 6"</p>
  
  <p>The problem seems to be with the IF, the update syntax works on its own, the select within the if statement works on its own. </p>
  
  <p>Any ideas??</p>
  
  <pre><code>CREATE PROCEDURE Get_SessionCookie(
  sessionID varchar(50),
  cookieID varchar(50)
  )
  
  IF (SELECT 1 = 1 FROM `SessionCookie` WHERE SessionID = sessionID AND CookieID = cookieID AND SessionExpiry &lt;  NOW())
  
  UPDATE SessionCookie
  SET SessionExpiry = NOW() + INTERVAL 60 MINUTE
  WHERE SessionID = sessionID AND CookieID = cookieID;
  
  SELECT 'True' FROM SessionCookie;
  
  ELSE
  
  SELECT 'False' FROM SessionCookie;
  </code></pre>