Re: customer ids

From: Date: Fri, 08 Jun 2007 14:33:03 +0000
Subject: Re: customer ids
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-256359@lists.php.net to get a copy of this message
At 3:40 PM +0100 6/6/07, blueboy wrote:
Hi, I want to create random customer ids. I have an auto incremented coulumn but I would rather have a 6-8 digit/letter id randomly generated that can be used as a unique identifier across 3 tables. Does anyone have a algorithm to generate such a string and can you give the odds against 2 duplicate stings being generated? I know this is a strange ask. R.
What about this: http://es2.php.net/manual/en/function.uniqid.php And if you're really concerned about duplication, then check the dB each time to see if it's already there -- that's what I do. Cheers, tedd -- ------- http://sperling.com http://ancientstones.com http://earthstones.com

« previous php.general (#256359) next »