Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts

    PHP - mysql Count row values together

    I have problem to count row values together. What I want to count is follow

    Name - - - aus - - - mal - - - chi
    Joey - - - - 4 - - - - 5 - - - - 2
    Jussi - - - - 4 - - - - 5 - - - - 3

    It should look like something like this

    Name - - - Total
    Joey - - - - 11
    Jussi - - - - 12

    I have checked multiple threads but I just dont get it.

  • #2
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,090
    Thanks
    51
    Thanked 506 Times in 493 Posts
    select `Name`, `aus` + `mal` + `chi` as Total from <table_name>
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!

  • Users who have thanked tangoforce for this post:

    maici (06-29-2013)

  • #3
    New to the CF scene
    Join Date
    Jan 2013
    Posts
    8
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by tangoforce View Post
    select `Name`, `aus` + `mal` + `chi` as Total from <table_name>
    Thank you one problem less now

  • #4
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,090
    Thanks
    51
    Thanked 506 Times in 493 Posts
    No worries!
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Posting Permissions

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