Re: Re: Random Unique ID
| From: | Roman Neuhauser | Date: | Thu, 22 Mar 2007 08:27:14 +0000 |
| Subject: | Re: Re: Random Unique ID | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-251074@lists.php.net to get a copy of this message | ||
# turnermm02@shaw.ca / 2007-03-21 21:03:35 -0500:
> Mark wrote:
> >ccspencer@softhome.net wrote:
> >
> >>Hello,
> >>
> >>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?
> >>
> >>Best,
> >>
> >>Craig
> >.
> >
> >I suggest looking into a GUID sort of thing, it is all coded for you and it
> >works just like you want.
>
> If you are running Linux, you can get this using:
> $GUID = exec("uuidgen");
http://www.ossp.org/pkg/lib/uuid
--
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man. You don't KNOW.
Cause you weren't THERE. http://bash.org/?255991