Jump to content

can't add database values


ueon

Recommended Posts

if ($addexperience) {
$getexpx = mysql_query("SELECT exp FROM profile WHERE profileid='$id'");
$getexp = mysql_fetch_row($getexpx);
$exp = $getexp['exp'];
$expreal = $exp + 50;

$insertexp = mysql_query("UPDATE work SET exp='$expreal' WHERE WorkID='$workid'");
 echo $expreal;
}

 

the 'exp' starts are 0, and only adds up to 50, but I'd like it add 50 every time this code is executed

Link to comment
https://forums.phpfreaks.com/topic/240536-cant-add-database-values/
Share on other sites

Well, it depends on what your end goal is. Is all that's necessary to add 50 to the value of `exp` in the `work` table each time the query runs or is there a specific reason you have it tied to the `exp` table as well?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.