On Wed, March 21, 2007 5:40 pm, [EMAIL PROTECTED] wrote:
> Thanks. Yes, I check for errors. But there are other types of errors
> so I'd need to verify that it is a duplicate key error and, in my
> ignorance, I have not yet figured out how to do that programatically.
> I worry about getting into
abase engine that supports replication, since that's the only way to
ensure keys won't get repeated over multiple servers.
Satyam
- Original Message -
From: <[EMAIL PROTECTED]>
To:
Sent: Friday, March 23, 2007 7:48 PM
Subject: [PHP] Re: Random Unique ID
Robert C
Robert Cummings writes:
Bleh, you can solve this with at most 2 queries.
Thanks. That is a bit different than what I was thinking
about but it might work for my purposes. Thanks also to all
the other people who made suggestions.
It appears to me that ther are 3 distinct approaches.
1) Ge
[EMAIL PROTECTED] 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
>
Tijnema ! wrote:
> On 3/22/07, markw@mohawksoft.com wrote:
>> > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> >> # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
>> >> > Tijnema ! wrote:
>> >> >
>> >> > > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> >> > >>
>> >> > >>
On 3/22/07, markw@mohawksoft.com wrote:
> On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
>> > Tijnema ! wrote:
>> >
>> > > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >> http://www.ossp.org/pkg/lib/uuid
>> > >
> On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> # markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
>> > Tijnema ! wrote:
>> >
>> > > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> > >>
>> > >> http://www.ossp.org/pkg/lib/uuid
>> > >
>> > > Note that this doesn't gonna work w
On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
# markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
> Tijnema ! wrote:
>
> > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
> >>
> >> http://www.ossp.org/pkg/lib/uuid
> >
> > Note that this doesn't gonna work when safe mode is on..!
# markw@mohawksoft.com / 2007-03-22 08:49:59 -0400:
> Tijnema ! wrote:
>
> > On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
> >>
> >> http://www.ossp.org/pkg/lib/uuid
> >
> > Note that this doesn't gonna work when safe mode is on..!
Ralf S. Engelschall's OSSP UUID library wrapped in a P
Tijnema ! wrote:
> On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
>> # [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
>> > Mark wrote:
>> > >[EMAIL PROTECTED] wrote:
>> > >
>> > >>Hello,
>> > >>
>> > >>I want to add a random unique ID to a Mysql table. Collisions
>> > >>are unlikely but p
On 3/22/07, Roman Neuhauser <[EMAIL PROTECTED]> wrote:
# [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
> Mark wrote:
> >[EMAIL PROTECTED] 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
# [EMAIL PROTECTED] / 2007-03-21 21:03:35 -0500:
> Mark wrote:
> >[EMAIL PROTECTED] 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 collisi
On Thu, 2007-03-22 at 08:14 +0400, Rabih Tayyem wrote:
> Actually I told you that the possibility of collision is small because I
> wanted to be scientific
> Scientifically, I can say this posibilty goes to 0...
Only as the length of the ID approaches infinity :B
Cheers,
Rob.
--
.---
Actually I told you that the possibility of collision is small because I
wanted to be scientific
Scientifically, I can say this posibilty goes to 0...
It is a random ID (not a totally random but based on the current timestamp)
generated not only once but twice based on two different time s
Mark wrote:
[EMAIL PROTECTED] 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
[EMAIL PROTECTED] 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
>
On Wed, 2007-03-21 at 16:40 -0600, [EMAIL PROTECTED] wrote:
> Jim Moseby writes:
>
> >> However, altho I know that by making the random number big enough
> >> the likelyhood of collisions can be made vanishingly small, I was
> >> actually concerned with eliminating the possibility of collisions
>
Jim Moseby writes:
However, altho I know that by making the random number big enough
the likelyhood of collisions can be made vanishingly small, I was
actually concerned with eliminating the possibility of collisions
altogether by checking to see if the number had been used before.
I just do
[EMAIL PROTECTED] wrote:
Stut writes:
[EMAIL PROTECTED] 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 newb
> Rabih Tayyem writes:
>
> > PS: I don't take credit for the code as it is a modified version of
> > a code I found long time back (this same code is running on one of
> > my applications for months without any problem)..
>
> Thanks. I'll find use for that!
>
> However, altho I know that by
Rabih Tayyem writes:
PS: I don't take credit for the code as it is a modified version of
a code I found long time back (this same code is running on one of
my applications for months without any problem)..
Thanks. I'll find use for that!
However, altho I know that by making the random num
Stut writes:
[EMAIL PROTECTED] 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
22 matches
Mail list logo