What would be easier to do/create?
1:
I want to create a particular number as an invoice #.
How can I create a random number from say 1-500000 and check against a database? If the number is found in the database, than go back to the beginning and start over to create another one and check again until the number created is NOT in the database so that I can put it in a variable for later use.
OR,
2:
How can I take the date and time, remove the separators (the / from the date and the : from the time) and create a unique ID?
Probably the second choice would be easier, I think. Any suggestions and how to do this?
THANK YOU
1:
I want to create a particular number as an invoice #.
How can I create a random number from say 1-500000 and check against a database? If the number is found in the database, than go back to the beginning and start over to create another one and check again until the number created is NOT in the database so that I can put it in a variable for later use.
OR,
2:
How can I take the date and time, remove the separators (the / from the date and the : from the time) and create a unique ID?
Probably the second choice would be easier, I think. Any suggestions and how to do this?
THANK YOU