| code_junkie |
12-17-2008 02:51 PM |
Unique random number?
I have a site for my company that requires a report number. This report number is the id for a specific report, so must be unique. At first I assumed that just a randomly generated number would work, but didn't think the site would get as many reports as it is. So now I need to set it so the random number is unique. How can I do this? My first thought is to query the db to see if the number exist then somehow get a new number if it does exist, but that seems like the wrong way to me. Can someone help me?
|