RE: [Phplib-users] db->nextid()
Brought to you by:
nhruby,
richardarcher
From: Rob H. <rob...@ws...> - 2002-10-22 00:03:40
|
nextid is meant to replace the auto_increment functions in dbs where it either does not exist, or is hard to access. It is meant as an equalizer. There is a table, whose name is settable, that holds a list of names and values. NextID simply locks the record, increments the value by one, then unlocks it. It is a fairly sexy solution to one of those obnoxious problems that you run into when trying to write portable apps. In the setup scripts, one of them has sql to set up the table. Thanks, Rob Hutton Web Safe www.wsafe.com > -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf Of Aric Caley > Sent: Monday, October 21, 2002 7:51 PM > To: Phplib-Users > Subject: [Phplib-users] db->nextid() > > > I just happened across this function. > > I'm assuming that this is meant as an alternative to an auto increment > field? Or to generating a random and hopefully unique number? > > I'm rewriting a project that uses a lot of MD5() calls to get > unique numbers > for things like categories and such. I thought to myself why not just use > auto increment in the database. I had read that the MD5 > technique was being > used specificaly to reduce possible colisions when inserting new records > over using auto increment. Is this nextid() function meant to solve the > same problem? Because I rather like it as opposed to MD5 which returns a > big long ugly string... > _______________________________________________ > Phplib-users mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phplib-users > |