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. Quote Link to comment 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']) Quote Link to comment 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']."'"); Quote Link to comment Share on other sites More sharing options...
Imtehbegginer Posted February 24, 2007 Author Share Posted February 24, 2007 Thanks! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.