Re: Mysql gives error except code executes correctly!?!

From: Date: Tue, 21 Nov 2000 12:46:34 +0000
Subject: Re: Mysql gives error except code executes correctly!?!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-26429@lists.php.net to get a copy of this message
----- Original Message ----- From: "Noah Spitzer-Williams" <noahsw@cyberdude.com> To: <php-general@lists.php.net> Sent: Monday, November 20, 2000 5:42 AM Subject: [PHP] Mysql gives error except code executes correctly!?! > Hey guys, i have the following code for updating votes in a database: > > $uv = "v".$rating."=v".$rating."+1"; > $usex = "sex".$csex."=sex".$csex."+1"; > $uage = "age".$cage."=age".$cage."+1"; > $urace = "race".$crace."=race".$crace."+1"; > $uloc = "loc".$cloc."=loc".$cloc."+1"; > $sql = "UPDATE pet_pics SET $uv,$usex,$uage,$urace,$uloc WHERE id='$id'"; > $res = mysql_query($sql); > $arr = mysql_fetch_array($res); > > if i were to print the sql statement, it would read: > UPDATE pet_pics SET > v1=v1+1,sexm=sexm+1,age3=age3+1,race2=race2+1,loc4=loc4+1 where id='2' > > now sql says its not a valid result resource except when i check my > database, the fields have been updated! > > anyone know whats goin on here? > > -Noah I'm thinking here not sure take a look at the where id='$id' and what you say it prints '2' should it not be where id=$id again just thinking

« previous php.general (#26429) next »