title: Passing variables on MySQL insert to be used in triggers
body: <p>I would like to create an insert that triggers subsequent inserts depending on if the variable exists.</p>
  <p>For example:</p>
  <pre><code>insert into `user`(`name`,`app`) values(&quot;matthew&quot;,1);
  </code></pre>
  <p>Triggers (on insert or after insert):</p>
  <pre><code>if new.`app` then    
   insert into `user_app`(`user`,`app`) values(new.`id`,new.`app`);
  end if;
  </code></pre>
  <p>Is it possible to create subsequent inserts using variables from an &quot;initial&quot; insert? Even if the column doesn't exist. For example, table <code>user</code> does not have column <code>app</code>, but it can use that variable and insert it into <code>user_app</code> with the <code>id</code> of the last inserted <code>user</code>.</p>