Jump to content

[SOLVED] Help please!


Imtehbegginer

Recommended Posts

if (($_POST['str'] + $_POST['int'] + $_POST['con'] + $_POST['dex']) > $row['statp']) {
  die('Not enough points!');
}
$stats_new = $_POST['str'] + $_POST['con'] + $_POST['dex'] + $_POST['int'] = $
$result = mysql_query("UPDATE characters SET str = '".$_POST['str']."' WHERE char_name = '".$_GET['char']."'");
$result = mysql_query("UPDATE characters SET dex = '".$_POST['dex']."' WHERE char_name = '".$_GET['char']."'");
$result = mysql_query("UPDATE characters SET con = '".$_POST['con']."' WHERE char_name = '".$_GET['char']."'");
$result = mysql_query("UPDATE characters SET _int = '".$_POST['int']."' WHERE char_name = '".$_GET['char']."'");
[b]$result = mysql_query("UPDATE characters SET statp = '".$_POST['statp']."' WHERE char_name = '".$_GET['char']."'");[/b]

 

I wish to know, how I take away the amount of $_POST['str'] + $_POST['con'] + $_POST['dex'] + $_POST['int'] from the statp row.

Link to comment
https://forums.phpfreaks.com/topic/39950-solved-help-please/
Share on other sites

i think what you are wanting is something like:

 

$total = $row['statp'] - ($_POST['str'] + $_POST['con'] + $_POST['dex'] + $_POST['int']);
$result = mysql_query("UPDATE characters SET statp = '".$total."' WHERE char_name = '".$_GET['char']."'");

Link to comment
https://forums.phpfreaks.com/topic/39950-solved-help-please/#findComment-193143
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.