title: Multiple Queries in Triggers
body: <p>I'm fairly new to using triggers and have a tiny question.
  I have a trigger finds a match between a newly inserted enquiry and a customer table.</p>
  
  <pre><code>INSERT INTO customersmatched (customerID,enquiryID) SELECT id, NEW.id FROM customer AS c WHERE c.customerName=NEW.companyName HAVING COUNT(id)=1;
  </code></pre>
  
  <p>I then need to update the newly inserted enquiry so it has a status which shows it's matched (but only if it has matched). So I tried adding this line after the insert.</p>
  
  <pre><code>UPDATE enquiry SET status="Live-Enquiry" WHERE id IN ( SELECT enquiryID FROM customersmatched WHERE enquiryID = NEW.id);
  </code></pre>
  
  <p>Except I get this error:</p>
  
  <blockquote>
    <p>MySQL said: #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 'UPDATE enquiry SET status="Live-Enquiry" WHERE id
    IN ( SELECT enquiryID FROM cus' at line 5</p>
  </blockquote>
  
  <p>How do I allow multiple queries within a trigger. I've tried doing something like in this link: <a href="https://stackoverflow.com/questions/1921627/multiple-insert-update-statements-inside-trigger">Multiple insert/update statements inside trigger?</a></p>
  
  <p>But doesn't work either. I'm using phpmyadmin btw. Can anyone help? :D</p>