Announcement

Collapse
No announcement yet.

Adding values from MyAQL

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Kind Regards
    Rob
    www.gnjgf.co.za
    www.oryan-projects.com

  • #2
    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.
    Mattski

    http://www.ScorpioFire.com


    Comment

    Working...
    X