title: MySQL Trigger with a Inner Join
body: <p>I have two tables in mySQL, call them reviews and products. And then I have another table (call it productsmaster) that is an inner join of reviews and products. I am trying to create a trigger to run the inner join query when a new record is added to reviews.</p>
  
  <p>I have tried to just insert the inner join query into the trigger, but it is returning a "#1422 - Explicit or implicit commit is not allowed in stored function or trigger." error. For clarity of the issue my code for the trigger is:</p>
  
  <pre><code>CREATE TRIGGER updateprodmaster 
  AFTER INSERT ON reviews 
  FOR EACH ROW 
  BEGIN 
  CREATE TABLE productsmaster AS
  SELECT products.*, reviews.userid, reviews.usergender, reviews.userage, reviews.score
  FROM products
  INNER JOIN reviews
  ON products.pid=reviews.pid;
  END;$$
  </code></pre>
  
  <p>If anyone has any thoughts on this it would be much appreciated. Thanks!</p>
  
  <p>Jack</p>