Re: Update / Delete / Insert quandry

From: Date: Thu, 06 Jan 2005 18:44:00 +0000
Subject: Re: Update / Delete / Insert quandry
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-38025@lists.php.net to get a copy of this message
On Thu, 6 Jan 2005 07:28:32 -0800 (PST), Stuart Felenstein <stuart4m@yahoo.com> wrote: > > The problem I'm having a hard time getting my hands > around are those areas where they can have multiple > entries. > > One of the tables allows for a user to enter up to 5 > choices. The table would look like this: > I think you need to have a primary key that's unique per record. That would allow you to make modifications per record without worrying about the duplicated RecordID. As far as updates and additions go, I usually keep the two separate when designing applications. Being able to update multiple rows at once shouldn't be a problem, you just select all the data, display it to your users with the appropriate form elements (select boxes, check boxes and such), and index it in your form by the unique id field. I don't think it's necessary to delete the records and reload them, doing that adds database load and increases the chance that something will go wrong. I hope I've touched on the items that concern you, feel free to write back if you need more information.

« previous php.db (#38025) next »