I'm trying to do some simple updates to a table for the referral program on my website, but somethings just not working right. I have pretty much identical code for two update queries, but only one works. observe....
$sql = "UPDATE users SET credits = credits + .05 WHERE ID=$grandparentID";
$result = mysql_query($sql);
// Log that they received this by referral
$sql = "UPDATE users SET refcredits = refcredits + .05 WHERE ID=$grandparentID";
$result = mysql_query($sql);
The "refcredits" column is consistently increased by .05 every time the script runs. The "credits" column behaves erratically. Sometimes it will add 0.1, sometimes it will add nothing. This pattern does seem to alternate.
Both columns are FLOAT types...I don't know what might be causing this. There are no conditionals involved. Anyone have any thoughts? Thanks.