RE: Re: Random Unique ID

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> 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 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 don't know how to do that properly with Mysql.  Perhaps it
> is necessary to lock to table, check, make the insert and then
> unlock it.  But I was hoping that there would be a simpler way. 

Replied off-list with a solution.

JM

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux