Re: update count

From: Date: Wed, 16 Jun 2004 18:39:52 +0000
Subject: Re: update count
References: 1 2 3  Groups: php.db 
Request: Send a blank email to php-db+get-34818@lists.php.net to get a copy of this message
I don't think you can have a relation (table) without a unique key. Either a single field or a unique relation between 2 or more fields is necessary for the table. Franciccio "Bob Lockie" <bjlockie@lockie.ca> ha scritto nel messaggio news:40D05759.9000901@lockie.ca... > On 06/16/04 09:53 John Nichel spoke: > > Bob Lockie wrote: > > > >> What is the best way to only do an update if it going to update only > >> one row? > >> I want to protect my code so that it won't accidentally update more > >> than one row. > >> I can do a select first but there must be an easier way. :-) > >> > > > > UPDATE thisDB.thisTable SET thisTable.thisColumn = 'thisValue' WHERE > > thisTable.uniqueColumn = 'someUniqueValue' > > Ok, a primary key is unique, right?

« previous php.db (#34818) next »