Re: Re: UPDATE Not Updating

From: Date: Fri, 03 Aug 2001 14:28:34 +0000
Subject: Re: Re: UPDATE Not Updating
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-11037@lists.php.net to get a copy of this message
> At 03.08.2001 14:39, Steve Fitzgerald wrote: > >I echoed out the $update_contact_sql and I'm getting > > > >FirstName='Value', etc. WHERE ContactID='' > > > >There is no value in ContactID. I've changed the double quotes to single > >quotes and dropped the quotes all together with $ContactID. I ran the query > >in MySQL client and gave the ContactID a value which worked fine. I'm not > >sure why the query string is not passing the value. > > Firstly the reason it doesn't give any error back is because you've got the @ > in there... @ infront of a function suppresses any error being sent to the > user. that doesn't matter in this case, WHERE ContactID='' is perfecately valid SQL syntax, it just updates all rows where ContactID isn't set to anything. That said tho, it is good practice to take out all @ 's when testing a script that isn't behaving as expected. In generaly they should only be used when either it is an "allowable" error or that outputing the error from a non-critical section of code would cause more problems. tom

« previous php.db (#11037) next »