I'm having some problem with the website I'm creating. I need to create a tracking number like this ABC-0001-15.
- The ABC will depend on the department
- The 0001 is an incremental from the database
- and 15 is the year
I want it to go back to 0001 if the year changes.
How can I achieve this ? I've done my research but I can't find how to, or I don't know the keyword to use.
I found this article on this site How to make MySQL table primary key auto increment with some prefix
but I need the user of the website to see the auto-number