Hey all. I have a slight bug on my website. A number of my pages use a variety of operators in simple math functions. Just recently, JUST recently have they begun to act weird. For instance, when asking to add 1 it adds 2 instead. This goes for a number of different codes which are all pretty normal looking. Here’s some of the code that doesn’t work:
[quote]$lol1 = ($userdata[‘example’] * 25);
$add2 = ($userdata[‘user_example2’]);
$add3 = $add2 + $add;[/quote]
Okay, now this would seem pretty fine, right? Takes the number of whatever it is you have, multiply it by twenty five. Then when I do the query, it adds whatever the outcome is. WRONG. It doubles. So, say the sum of example * 25 = 100, it’ll add 200 to the user’s database. Here’s a second issue.
[quote]$addition = ($userdata[‘example3’] + 1);
$dbquery = “UPDATE “.$db_prefix.“users SET example3= ‘$addition’ WHERE user_id=’”.$userdata[‘user_id’].”’”;[/quote]
Again, instead of just adding one to the table, it adds two. And that’s all the codes consist of. I haven’t edited anything. Can anyone help because this is holding the release of my project back.