Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Sum of table rows will appear in a textfield
Old 12-13-2010, 04:42 AM Sum of table rows will appear in a textfield
Skilled Talker

Posts: 97
Name: rhoda
Trades: 0
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:
<?php
  if($_POST["clt_no"])
    {
    $query = "SELECT * FROM clt_transact WHERE  clt_no = '" . $_POST . "'";
    $result_no = mysql_query($query);
        if($result_no)
            {
            if(mysql_num_rows($result_no) > 0 )
            $operation2_input = 0;
            
            $query = "SELECT SUM(t.input_qty) AS operation_input FROM clt_traceability t, clt_transact p WHERE t.clt_transact_id = p.clt_transact_id AND t.operation_name 'Operation2' AND p.clt_no='" . $_POST["clt_no"] . "'";
            $resultyield = mysql_query($query);
            if($resultyield)
                {
                    if(mysql_num_rows($resultyield) > 0)$operation2_input =mysql_result($resultyield,0,"operation2_input");
                }
              $operation2_total = $operation2_input;
            }
    }
?>
I want to happen is all the input qty that the user insert in input qty textfield will sum and the result will appear in operation2_total in input_qty textfield.
I 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
Attached Files
File Type: txt cmain3.txt (10.8 KB, 0 views)
newphpcoder is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 12-15-2010, 01:27 AM Re: Sum of table rows will appear in a textfield
Skilled Talker

Posts: 97
Name: rhoda
Trades: 0
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
Attached Files
File Type: txt cmain9.txt (10.6 KB, 0 views)
newphpcoder is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Sum of table rows will appear in a textfield
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.19257 seconds with 13 queries