Re: Random Unique ID

From: Date: Wed, 21 Mar 2007 20:37:53 +0000
Subject: Re: Random Unique ID
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-251044@lists.php.net to get a copy of this message
Stut writes:
ccspencer@softhome.net wrote:
I want to add a random unique ID to a Mysql table. Collisions are unlikely but possible so to handle those cases I'd like to regenerate the random ID until there is no collision and only then add my row. Any suggestions for a newbie as to the right way to go about doing this?
1) Not even slightly PHP related.
Perhaps not. It is Mysql related. And seeing other Mysql discussion on this list inspired me to ask.
2) Why random? Incrementing not good enough for you?
I want to use it in a way that will expose it to the user. And I don't want to give out information as to the order of records in my database. Best, Craig ------------------------------------------------------
-     Virtual Phonecards - Instant Pin by Email      -
-           Large Selection - Great Rates            -
-     http://speedypin.com/?aff=743&co_branded=1     -
------------------------------------------------------ 
**************************************
*                                    *
*          Craig Spencer             *
*      ccspencer@SoftHome.net        *
*                                    *
************************************** 


« previous php.general (#251044) next »