title: MySql On update, select into another table conditionally
body: <p>I have two tables <code>posts_app</code> and <code>posts_unapp</code>. Both are same in structure.</p>
  
  <p><strong>posts_app - contains moderated posts</strong></p>
  
  <pre><code>"id"    "title" "body"  "url"   "user"  "country"
  </code></pre>
  
  <p><strong>posts_unapp - fresh posts end up here</strong></p>
  
  <pre><code>"id"    "title" "body"  "url"   "user"  "country"   "Status"
  1       Hello   Test    Foo     Bar     Tar         2
  </code></pre>
  
  <p><code>posts_unapp</code> contains new posts, which a moderator has not yet approved. New posts are inserted with <code>status = 2</code> (which means they have not yet been checked and are neither approved or rejected).</p>
  
  <p>Once a moderator has checked a post, the column <code>status</code> is updated to <code>true</code> if approved, or <code>false</code> if rejected. At this time, is it possible to automatically copy the post to the <code>posts_app</code> table only if the status is set to true?</p>
  
  <p>One way of thought of doing this was by using a <code>trigger on update</code> on <code>posts_unapp</code>. But the problem is, a moderater can set a <code>status</code> to <code>true</code> or <code>false</code>. Both count as updates and both will fire the trigger. Setting <code>status = flase</code> need not copy the data, the data needs to be copied only when the the <code>status</code> is set to <code>true</code>.</p>
  
  <p>What would be a good way to do this? I've decided to use two tables to keep the <code>posts_app</code> table clean.</p>