title: How to change mysql delimiter through php
body: <p>I created an event with a set of sql statements in mysql terminal, It is working fine. But I want to create this event from php script. My query is below.</p>
  
  <pre><code>DELIMITER |
  
  CREATE EVENT e_cart
  
  ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 3 MINUTE
  
  DO
  
  BEGIN
  
  SET @var_orderid = '';
  
  SET @var_orderid = (SELECT orderid FROM order WHERE id=308);
  
  IF @var_orderid = NULL THEN
  
  UPDATE order SET status=1 WHERE id=308;
  
  END IF;
  END |
  
  DELIMITER ;
  </code></pre>
  
  <p>This results in :-</p>
  
  <blockquote>
    <p>Error : 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 'DELIMITER |
                    CREATE EVENT e_cart
                ON SCHEDULE AT CUR' at line 1</p>
  </blockquote>
  
  <p>How do I execute this event from php script?</p>