Results 1 to 2 of 2

Thread: Adding values from MyAQL
      
   

  1. #1
    Join Date
    Nov 2006
    Location
    Centurion, South Africa
    Posts
    582

    Question Adding values from MyAQL

    Hi Folks,

    I have the following scenario.

    I have a page that can be veiwed at http://www.gnjgf.co.za/rhresultstest.php

    The idea is to sum the numbers right of the word "PAR" and the result to be posted under the word "OUT"

    Similarly for the next nine values and thier result to appear under the word "IN"

    Then I would like it to add "OUT"+"IN" and post the result to appear under "TOTAL"

    I look forward to your replies

  2. #2
    Join Date
    Jan 2008
    Location
    Colorado
    Posts
    78

    Default Re: Adding values from MyAQL

    Rob, you have a couple options for summing values.

    1) You can add the sum as part of your SQL query by adding it in the SELECT statement. Something like: SELECT (par1 + par2 + par3 ... + par9) AS Out. You can then use this value when you output the data for your page.

    2) Since you are likely looping through your results to display your table you can add a PHP variable to add the par values with each loop.

    Some of this depends on how your table is set up and how you are looping through your results.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •