title: MySQL Trigger to update count after insert
body: <p>I need some help with a mysql trigger. I am currently trying to tidy up some code and offload some processing to the mysql database rather than running 2 queries and joins etc...</p>
  
  <p>When someone inserts into a video into a database, I would like the video count in the category to update.</p>
  
  <p>So you specify the category id.</p>
  
  <p>This is what I have so far so any help would be good as i just dont seem to be able to get the syntax correct.</p>
  
  <pre><code>CREATE TRIGGER 'db_videos'.'update_video_count'
  AFTER INSERT ON 'videos' FOR EACH ROW
  BEGIN
      UPDATE video_cat WHERE video_count = video_count + 1 WHERE video_cat = video_cat;
  END;
  </code></pre>