title: MySQL AUTO_INCREMENT according to year
body: <p>Im creating a ticketing system and this is my table structure:</p>
  
  <pre><code>CREATE TABLE tix_sip
  (
  tktNum INT UNSIGNED NOT NULL,
  sipNum INT UNSIGNED AUTO_INCREMENT,
  PRIMARY KEY( sipNum ),
  FOREIGN KEY(tktNum) REFERENCES Tix (tktNum)
  );
  </code></pre>
  
  <p>what I would like to happen with my <code>sipNum</code> is to be numbered according to year.</p>
  
  <p>Example: <code>20140001, 20140002, ..20140334, 20140335....</code></p>
  
  <p>How do I make it change the first 4 digits automatically so everytime next year comes, it will create new\another set of <code>AUTO_INCREMENT</code>ed numbers</p>
  
  <p>Example: <code>20150001, 20150002........ 20160001, 20160002..</code></p>
  
  <p>btw, Im using php code for my program, in case that could help if a solution would be creating a function. Thanks</p>