I intend to do the following, Pls help with the calculation Code:
1. retrieve data from MySQL Table
2. Perform Calculation with the data to get result (to 2 decimal Place)
3.the result is generated when a Button in the Form is Clicked.
The Details are as follows:
Items| Qty | Price | Qty2 | price2 | Amnt | Amnt2 | Pay
Shoe| 2 | 500 | 5 | 700 | x | x | x
The Calculation to perform is:
Amnt = price1 * qty
Amnt2 = price2 * qty2
total = qty1 + qty2
pay = amnt1+amnt2/total
Pay should be in 2 decimal Place, and would be genera when a Button is clicked.
Pls Help with the Calculation and Clicking Code.
Thanks
Perform calculations when a button is Clicked
Moderator: General Moderators
-
Engr Chidi
- Forum Newbie
- Posts: 2
- Joined: Mon Sep 17, 2012 5:06 am
- Grizzzzzzzzzz
- Forum Contributor
- Posts: 125
- Joined: Wed Sep 02, 2009 8:51 am
Re: Perform calculations when a button is Clicked
what code have you come up with so far?
Re: Perform calculations when a button is Clicked
Are you planning to use AJAX or just send a new page? You are aware, I assume, that by the time the browser displays the page with the button, PHP is no longer active, so you can't do anything like this with PHP alone, unless you want to send an entire new page.