Union of numbers inside a MYSQL table

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bnashenas1984
    Contributor
    • Sep 2007
    • 257

    Union of numbers inside a MYSQL table

    Hi everyone
    I need to retrieve the union of numbers in a MYSQL table with PHP
    Here is an example:

    Code:
    +--------+---------+
    | users  | points  |
    +--------+---------+
    | David  |     10  |
    | Peter  |     18  |
    | John   |     23  |
    +--------+---------+
    And what I need is to get 51 which is 10+18+23


    Thanks / Behzad
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    Read about the SUM function.

    Comment

    • bnashenas1984
      Contributor
      • Sep 2007
      • 257

      #3
      Hi
      And thank you r035198x
      You are a life saver

      THANKS AGAIN its working now.

      Comment

      Working...