From: Skip Evans Date: February 12 2007 4:50pm Subject: Interger values adding too much List-Archive: http://lists.mysql.com/php/5 Message-Id: <45D09ABB.10707@bigskypenguin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Hey all, I have the following code block: // get the number of points for this action $sql="SELECT points FROM bsp_story_points WHERE action='$action'"; $result=mysql_query($sql); if(mysql_errno()!=0) bsp_SystemError("$sql
".mysql_error()."
",__FILE__,__LINE__); $row=mysql_fetch_assoc($result); $pts=$row['points']; echo "
points to add:$pts"; // update the user's record with the new ponts. $sql="UPDATE users SET points = (points + $pts) WHERE id=$uid"; echo "
SQL:$sql"; $result=mysql_query($sql); if(mysql_errno()!=0) bsp_SystemError("$sql
".mysql_error()."
",__FILE__,__LINE__); echo "
points added"; exit; And here is the output from the echo statements: points to add:50 SQL:UPDATE users SET points = (points + 50) WHERE id=9252 points added Now, I checked the value right before the UPDATE call, and it was 700. I am absolutely certain of this, but the value in the points column for the table users after the UPDATE runs is 800, not 750 as it should be. I've been running tests on this for two days and am completely baffled! I have tried this an embarrassing number of times, and it always adds either 100 or 150 points instead of the 50 points I think it should. Any help on this would reward you with psychic pizzas with everything beamed your way. I'm desperate for a solution to this as it is supposed to go into production today. Thanks tons! Skip -- Skip Evans Big Sky Penguin, LLC 61 W Broadway Butte, Montana 59701 406-782-2240 http://bigskypenguin.com =-=-=-=-=-=-=-=-=-= Check out PHPenguin, a lightweight and versatile PHP/MySQL development framework. http://phpenguin.bigskypenguin.com/