RE: [PHP] How do you guys do this?

From: Date: Sat, 31 Jan 2004 19:28:02 +0000
Subject: RE: [PHP] How do you guys do this?
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-176467@lists.php.net to get a copy of this message
On Sat, 2004-01-31 at 12:57, Michal Migurski wrote: > >> users uploading two identically named files at the same time (not all > >> /that/ unlikely), and you are using a database table to track > > > >Really? You don't think it's that uncommon? Please give an example as I > >can't think of any. Not like that's saying much. :) > > 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? -- Adam Bregenzer adam@bregenzer.net

« previous php.general (#176467) next »