title: Reference number which automatically resets every month
body: <p>I am generating reference no <strong>REF-082013-001</strong> (REF-mmyyyy-001) and incrementing the last part for every entry. REF-082013-001 for first record and REF-082013-002 for second and so on.</p>
  
  <p>My Question is How can i reset the last number by php for every new month. Let say September 2013 I want it to be REF-09-2013-001 and auto increment it till the end of September and then in November reset it again.</p>
  
  <p>Is there a ways to do this in php. Your help is much appreciated. Thank you</p>
  
  <p><strong>Update</strong></p>
  
  <p>Currently <strong>'REF-'.date('m-Y').$maxnumberfromdb</strong> in single column called reference_no and Now thinking to store the <strong>mm-yyyy</strong> ref1 and last <strong>number</strong> in ref2 separately and start ref2 every first day of the month.  </p>