Imtehbegginer Posted February 24, 2007 Share Posted February 24, 2007 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 More sharing options...
Jessica Posted February 24, 2007 Share Posted February 24, 2007 If by take-away you mean subtraction... $newStatp = $row['statp']-($_POST['str'] + $_POST['int'] + $_POST['con'] + $_POST['dex']) Link to comment https://forums.phpfreaks.com/topic/39950-solved-help-please/#findComment-193141 Share on other sites More sharing options...
magic2goodil Posted February 24, 2007 Share Posted February 24, 2007 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 More sharing options...
Imtehbegginer Posted February 24, 2007 Author Share Posted February 24, 2007 Thanks! Link to comment https://forums.phpfreaks.com/topic/39950-solved-help-please/#findComment-193144 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.