![]() |
Sum of table rows will appear in a textfield
1 Attachment(s)
Good day!
I have a problem in adding codes in my php codes, but i have the concept of codes that i want to add in my php codes, but I don't know if it is right. Kindly check my codes thank you. I attached my whole codes for better understanding and here is the codes I want to add: Code:
<?phpI don't know how thus the result should be appear automatically in the input qty of operation2_total and if my code is correct. Thank you |
Re: Sum of input will appear in a textfield
1 Attachment(s)
I have 5 operation name: operation1, operation2, operation2_total, operation3,operation4,operation5. As you notice I have a operation2_total
How can I add the input qty of operation2 and the result will be appearing in input_qty of operation2_total. Thank you |
Re: Sum of table rows will appear in a textfield
If you want the sum use the sum sql function
SELECT SUM(COLUM_NAME_HERE) FROM table_name_here WHERE condition = 'some_condition_here' Check this picture example for getting the sum take note I'm using Microsoft SQL Server 2008 not MySQL. http://img52.imageshack.us/img52/5591/exmpcurr.jpg Also in your query your using the super global POST without getting a single value instead you'll get the entire array. You need to say a direct key like PHP Code:
PHP Code:
Code:
SELECT COUNT(*) FROM table_name_here WHERE condition = 'some_condition_here' |
| All times are GMT +5.5. The time now is 10:18. |