>> I used microtime() to differentiate them, but in retrospect it should
>> have been a no-brainer to use the database primary id to help
>> differentiate these, since the DB already did all the heavy lifting
>> involved in ensuring uniqueness.
>
>Even though it seems incredibly unlikely, isn't is safer to just not
>worry about it and use unique ids instead?  Why take the risk when you
>can use an autonumber from a database or md5(uniqid(rand(), true)), or
>even: time() .  md5(uniqid(rand(), true)) if you want to be really
>paranoid?

According to the docs, uniqid() relies on microtime() anyway, so it works
out to almost the same thing. You could just as well make a call to the
return value of the mktemp program, as well. Regardless, the important
thing is that you generate uniqueness /somewhere/ - if you're using a DB,
you get uniqueness for free! :)

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html

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

Reply via email to