From: Don S. <do...@se...> - 2002-10-21 13:17:12
|
I still don't understand why you aren't just getting the new ID value via the $db->nextId() function via PEAR sequences. I've tested this on my box and it worked great. I made sure to test it after stopping and starting mysql and apache and the sequence held true throughout. Using nextId would eliminate the need for table locking and any possibility of the evils of ID re-use. Don. On Sat, 19 Oct 2002, Matthew McNaney wrote: > > The way I'm reading this. You plan to derive your user id by selecting > > the current max id and incrementing it one? If this is the case, > > wouldn't you have a problem if multiple users happend to submit new > > user requests simultaneously? > > Not a problem. In fact I'm sure the PEAR solution requires the same process: > you just lock the table. > > $core->sqlLock("myTable"); > $core->sqlInsert($sql_array, "myTable", 1, "id_column", 1); > $core->sqlUnlock(); > > Sorry, forgot mention it. > > Matt > > > > > ------------------------------------------------------- > This sf.net email is sponsored by: > Access Your PC Securely with GoToMyPC. Try Free Now > https://www.gotomypc.com/s/OSND/DD > _______________________________________________ > Phpwebsite-developers mailing list > Php...@li... > https://lists.sourceforge.net/lists/listinfo/phpwebsite-developers > |