This code doesn't seem to work and I'm not sure why. I have been looking at the entire page that has been created and the only area that seems to not work is below. Obviously you can't see how my tables are setup although I was hoping that someone could notice something that may be obvious that I am overlooking. $previousenergy = mysql_query("SELECT energy FROM playerstats WHERE name = 'Moki'"); $currentenergy = ("$previousenergy" + 5); mysql_query("UPDATE playerstats SET energy = '$currentenergy' WHERE name = 'Moki'"); mysql_close($con); Code (markup): Thank you in advance, Brandon A.K.A Moki Mofiki
Hi Mate, What is the error you are getting: can you place error_reporting(0); at the top of your script! Graham
UPDATE playerstats SET energy = energy+$change_in_energy WHERE name = 'Moki' #Where $change_in_energy is the increase/decrease AND 'energy' is an integer type of field! Code (SQL): JFYI, In your previous code, '$previousenergy' is a resource, not an integer or a string. You will need to use the mysql_result() function to get the from data of it!