Echo calculated values retrieved by the ajax function.
Posted: Mon Jan 14, 2008 5:07 am
I have a a select box on my PHP file. Each time I select a value , several values are being retrieved
from MySQL.
I'm interested in calculating the value of one field called amount .
Namely, I want to have on the same page a variable that will add the new retrieved amount to the current SUM , calculate and present the total amount.
Each time I select a different value , current amount is being presented and the variable holds the total amount is being updated as well.
As I mentioned in the title, records are being retrieved using Ajax.
How can I achieve this ?
from MySQL.
I'm interested in calculating the value of one field called amount .
Namely, I want to have on the same page a variable that will add the new retrieved amount to the current SUM , calculate and present the total amount.
Each time I select a different value , current amount is being presented and the variable holds the total amount is being updated as well.
As I mentioned in the title, records are being retrieved using Ajax.
How can I achieve this ?