Jump to content

PHP & MYSQL Help


spike_132000

Recommended Posts

Hey there, can you have a look at the code below PLEASE!, and tell me what's wrong with it... What I want it to do is add [b]100 times the opponents level[/b] to [b]curexp[/b], then when [b]curexp[/b] is the same or higher than [b]nexexp[/b], it adds one to [b]level[/b] and makes [b]curexp[/b] equal [b]zero[/b] and make [b]nexexp=nexexp+1000[/b]...

The Code is below...
[code]print "<b>Congratulations, You have slain $oppstats3[playername] and have gained $ptsgained Skill Points.</b><br>";
        $updateyourstats="update km_users set skillpts='$skillpts+$ptsgained',honor='$honor+1',curexp='$curexp+100' where playername='$player'";
mysql_query($updateyourstats) or die("Could not update your stats");
$updateopp="update km_users set skillpts='$skillpts-$ptslost',dead='Yes',killer=$player,numberattck='0', honor='$honor-1' where ID='$playerID'";
        mysql_query($updateopp) or die(mysql_error());
        print "Back to <A href='index.php'>Main game page</a>.";
      }[/code]

Cheers. Spike_132000
Link to comment
https://forums.phpfreaks.com/topic/10188-php-mysql-help/
Share on other sites

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.