Mysql gives error except code executes correctly!?!
| From: | Noah Spitzer-Williams | Date: | Mon, 20 Nov 2000 12:42:02 +0000 |
| Subject: | Mysql gives error except code executes correctly!?! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-26249@lists.php.net to get a copy of this message | ||
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
--
-----------------
The DevBoard - http://www.thedevboard.com
-----------------
http://www.alladvantage.com/go.asp?refid=BIY971
- AllAdvantage