I am having a weird problem in that I can't get this code to update. I have a tone of other queries that work but this one will not. I even copied the ones that worked and just changed the names and it doesn't work.. I get no errors either..
$cur_health = GetCharInfo('char_health');
$new_health = $cur_health['char_health'] - $damage;
echo '<br>Current Health = '.$cur_health['char_health'].'<br>';
echo'You lost '.$damage.' health<br>';
echo 'New Health = '.$new_health.'<br>';
if($new_health<1)$new_health=1;
if(mysql_query("UPDATE rpg_char SET char_health = '".$new_health."'
WHERE char_name ='$user'") or die(mysql_error()))echo'good';
Health is set to 100, damage is set to 50.
I get current health = 100; you lost 50 health; new health = 50;and 'good' prints out.
But inside my database the value remains 100.. I don't get it? Any ideas?