Simple Search/return data/use data query

Trying to simply add 10k to the player balance on a minecraft server that uses a 2 tables for currency: 1 that contains the username and 2. contains the amount and id. They are linked together via the id, so I have to search for it first via name before I can update the balance via ID. Some names have been changed for security.

$result = mysql_query("SELECT id FROM sometable WHERE name = '".$minecraft_name."'");
while($wallet = mysql_fetch_row($result))
{
mysql_query("UPDATE someOTHERtable SET balance=balance+10000 WHERE (player_id='"$wallet"') AND (money_id='1')");
}

I get errors from php:
PHP Parse error: syntax error, unexpected T_STRING in /file/

Also upon just running this UPDATE query via php that runs perfectly fine in the SQL console via mySQL web access (with static values for player_id=/name= etc.), does nothing. (Example trying to set a value in a table. Works in SQL web access, but not via php scripts)

Look at your select query and your update and find the difference in the variable usage.

Sponsor our Newsletter | Privacy Policy | Terms of Service