The actual generation of a random number will not require a database. However, if you are looking to store the random string for later use, then you will need a database.
i first generate 2 sets of random numbers.
then i generate a number based on the current timestamp.
I then concatenate them
Refcode = rand1 + timestampNumber + rand2
using a date and timestamp to make a number and some random numbers thrown in will make sure the number is never used again ( as the current date and time wont happen again! )
Ie:
041042223287
__________________
Chris. ->> Please login or register to view this content. Registration is FREE <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
« Reply to How do i Generate unique reference number on form submission ?