Jump to content


Photo

PHP & MYSQL Help


  • Please log in to reply
4 replies to this topic

#1 spike_132000

spike_132000
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 22 May 2006 - 03:30 PM

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 100 times the opponents level to curexp, then when curexp is the same or higher than nexexp, it adds one to level and makes curexp equal zero and make nexexp=nexexp+1000...

The Code is below...
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>.";
      }

Cheers. Spike_132000

#2 spike_132000

spike_132000
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 22 May 2006 - 06:57 PM

Jeeez, I've waiting 4 hours and no one has replied... PLEASE HELP!!! How come i don't get a reply...

#3 spike_132000

spike_132000
  • New Members
  • Pip
  • Newbie
  • 7 posts

Posted 24 May 2006 - 09:44 AM

Okay... This is beyond a Joke! I only need help with this... I've waited 2 days and still no replys!! Everyone gets replies!!!

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 24 May 2006 - 01:18 PM

If you havn't got any replies then its most likey no one understands your question or doesn't know what to do. Also the snippet of code you have posted doesnt help much with your question at all.

#5 eves

eves
  • Members
  • PipPip
  • Member
  • 26 posts

Posted 24 May 2006 - 01:33 PM

$updateyourstats="update km_users set skillpts='".($skillpts+$ptsgained)."',honor='".($honor+1)."',curexp='".($curexp+100)."' where playername='$player'";

do that with the other query too.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users