Reference Number based on date
Posted: Mon Apr 11, 2011 7:40 pm
Hello,
I am wanting to create a PHP based job logging system more as an exercise in database driven web development but I have a problem I would like to solve.
I want to create a reference number that is based on the date in the following format:
RN1104120001
So RN is simply just a label to give a bit of clarity so it doesn't just look like a huge number.
110412 is YMD in two digit format.
0001 is the job number for that day.
So essentially the reference numbers will end up like so:
RN1104120001
RN1104120010
RN1104150001
RN1104150010
etc.
How can I create this number so that the last four digits will reset themselves to one the next day?
How can I get this so that it does checking to ensure that the last four digits are always different and never the same?
I can do this in FileMaker Pro but I want to create a web based system and I don't have the money for FileMaker Server as much as I want it.
Thanks so much for any assistance you can give me.
I am wanting to create a PHP based job logging system more as an exercise in database driven web development but I have a problem I would like to solve.
I want to create a reference number that is based on the date in the following format:
RN1104120001
So RN is simply just a label to give a bit of clarity so it doesn't just look like a huge number.
110412 is YMD in two digit format.
0001 is the job number for that day.
So essentially the reference numbers will end up like so:
RN1104120001
RN1104120010
RN1104150001
RN1104150010
etc.
How can I create this number so that the last four digits will reset themselves to one the next day?
How can I get this so that it does checking to ensure that the last four digits are always different and never the same?
I can do this in FileMaker Pro but I want to create a web based system and I don't have the money for FileMaker Server as much as I want it.
Thanks so much for any assistance you can give me.