First off I have a Main Menu - Then on the Main Menu I have a button to submit and GET data from a table called casesubmission. This table holds all of the Attorney Cases with filenumber, amountowed, etc.
Now what I am trying to do is to take a simple calculator code and turn it into a code that SUBTRACTS amountowed from casesubmission and UPDATE AND SET the amountowed WHERE filenumber equals filenumber. Now, the subtraction code is setup to echo num1 - num2; Is this the only way to get the result? I need num1 - num2 to be a result in a variable so I can tell the server to UPDATE casesubmission SET newamountowed = '$amountowed' WHERE filenumber = '$filenumber;
How do I get num1 minus num2 to equal newamountowed so I can update the database?
Keep this in mind too, On the Main Menu, you will submit to GET the file information, then once everything is echoed on VIEWCASE.PHP, then you will see the calculator along with the information. Probably also need to know how to carry the filenumber to be used in second query. Would I just say $filenumber = '$filenumber; Or $_POST['filenumber'];
Thos are the two issues I am having.
Thank you for the answers. What I did was $amountowed = $num1 - $numb2;
I also added a HIDDEN input to my form and called it filenumber with the value of PHP ECHO (echod the file number from Main Menu to View Case. I also added
$filenumber = mysqli_real_escape_string($dbc, trim($_POST['filenumber']));
and everything worked out great! It now subtracts the data and updates the database so I can post a payment made. Of course you must be logged in to do any of this and will refer to a specialist for security issues.
Thanks alot!
Sorry about not posting my code, but Yahoo Answers takes out part of the code when I paste it. There fore I only had actually 2 questions and both were resolved, one by the first answer and the other I figured out on my own. My code works fine. I don't know everything about PHP and MySQL. I am learning. Not everyone is an expert. That is why God created LEARNING. Unfortunately, I couldn't afford a college degree so I am buying my own college books and learning from home. Thanks to the users at Yahoo answers, I am able to get the quick help I need when I get stumped. Thanks alot!
Now what I am trying to do is to take a simple calculator code and turn it into a code that SUBTRACTS amountowed from casesubmission and UPDATE AND SET the amountowed WHERE filenumber equals filenumber. Now, the subtraction code is setup to echo num1 - num2; Is this the only way to get the result? I need num1 - num2 to be a result in a variable so I can tell the server to UPDATE casesubmission SET newamountowed = '$amountowed' WHERE filenumber = '$filenumber;
How do I get num1 minus num2 to equal newamountowed so I can update the database?
Keep this in mind too, On the Main Menu, you will submit to GET the file information, then once everything is echoed on VIEWCASE.PHP, then you will see the calculator along with the information. Probably also need to know how to carry the filenumber to be used in second query. Would I just say $filenumber = '$filenumber; Or $_POST['filenumber'];
Thos are the two issues I am having.
Thank you for the answers. What I did was $amountowed = $num1 - $numb2;
I also added a HIDDEN input to my form and called it filenumber with the value of PHP ECHO (echod the file number from Main Menu to View Case. I also added
$filenumber = mysqli_real_escape_string($dbc, trim($_POST['filenumber']));
and everything worked out great! It now subtracts the data and updates the database so I can post a payment made. Of course you must be logged in to do any of this and will refer to a specialist for security issues.
Thanks alot!
Sorry about not posting my code, but Yahoo Answers takes out part of the code when I paste it. There fore I only had actually 2 questions and both were resolved, one by the first answer and the other I figured out on my own. My code works fine. I don't know everything about PHP and MySQL. I am learning. Not everyone is an expert. That is why God created LEARNING. Unfortunately, I couldn't afford a college degree so I am buying my own college books and learning from home. Thanks to the users at Yahoo answers, I am able to get the quick help I need when I get stumped. Thanks alot!