I am getting a php with my mysql query that I'm trying to execute, and for the life of me I can't figure it out. I have tried wrapping the variable $money_earned in single quotes to no avail. It is a float. The $userdata variable is a string. I get this error when I run my code:
Parse error: syntax error, unexpected T_STRING
Here is my mysql query:
$query = "UPDATE `authentication` SET `money` = money + $money_earned WHERE `username` = '$userdata'";
mysql_query($query);
Here I will post the full code, hopefully that will allow this to be solved easier:
<?php
mysql_connect("blahblahblah");
mysql_select_db(blah) or die("Unable to select database");
$userdata = $_SESSION['userz'];
$secret_key = "TOPSECRET";
$user = $_GET['snuid'];
$money_earned = $_GET['currency'];
$id = $_GET['id'];
$secret = $_GET['verifier'];
$secret_check = md5($id.":".$user.":".$money_earned.":".$secret_key);
if($secret == $secret_check) {
$query = "UPDATE `authentication` SET `money` = money + $money_earned WHERE `username` = '$userdata'";
mysql_query($query);
} else {
}