|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Customizable ID's
Hello all,
let say we have a event database whivh contains eventID column. Is there a way to give eventID as follow e.g 4012734567 4 is the last digit of 2004 01 is month 27 is day and last 5 digit has to be created by system automatically. And I want it to be done for everyday auto... Thanks for help |
|
#2
|
||||
|
||||
|
One caveat: You might want to use "04" rather than just "4" in the even that your script is in use for more than 5 years and you roll into double digits for the year. As for generating the id, look into the date() function for generating the first part. Then use the rand() function to generate a random number between 10000 and 99999 and append it to the end of the date portion.
|
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > Customizable ID's |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|