Re: [PHP] uniqid() and repetition of numbers generated

2009-11-14 Thread German Geek
2009/11/14 tedd > A > Interesting thought. My idea on this is to use the approach used when replicating a DB. It is similar to the namespace idea if not the same: Say you have 3 databases, you could use mod 3 numbers for A=0, B=1 and C=2 So on A you would have 0, 3, 6, 9, ... on B 1, 4, 7, 10,

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-13 Thread tedd
At 9:11 AM +1000 11/13/09, Angus Mann wrote: Thanks Ashley. To clarify, the reason I don't want to use auto-increment : different users with their own populated databases may wish to merge some or all of their data. The unique identifier needs to be carried along with the rest of the data, henc

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-13 Thread Ashley Sheridan
On Fri, 2009-11-13 at 14:30 +1000, Angus Mann wrote: > > Here's part of the confusion: > > > > If you were to express the number of microseconds since 1970 in a > > decimal number, it would indeed take 16 digits. > > > > But uniqid() returns a /13 character string/, not a 13 digit number. The > >

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-12 Thread Angus Mann
Here's part of the confusion: If you were to express the number of microseconds since 1970 in a decimal number, it would indeed take 16 digits. But uniqid() returns a /13 character string/, not a 13 digit number. The string is actually a hexadecimal number (and thus can express a greater range o

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-12 Thread John List
Angus Mann wrote: Original Message - From: Ashley Sheridan To: Angus Mann Cc: php-general@lists.php.net Sent: Friday, November 13, 2009 8:31 AM Subject: Re: [PHP] uniqid() and repetition of numbers generated On Fri, 2009-11-13 at 08:22 +1000, Angus Mann wrote: Hi all

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-12 Thread Angus Mann
Original Message - From: Ashley Sheridan To: Angus Mann Cc: php-general@lists.php.net Sent: Friday, November 13, 2009 8:31 AM Subject: Re: [PHP] uniqid() and repetition of numbers generated On Fri, 2009-11-13 at 08:22 +1000, Angus Mann wrote: Hi all. I'm sure I can

Re: [PHP] uniqid() and repetition of numbers generated

2009-11-12 Thread Ashley Sheridan
On Fri, 2009-11-13 at 08:22 +1000, Angus Mann wrote: > Hi all. I'm sure I can't be the first person to ask this question but a > search of the net leaves me confused. > > I need a unique identifier in an SQL table and for complicated reasons I > don't want to use auto-increment. > > So I thoug