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,301
    Thanks
    57
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    select `Name`, `aus` + `mal` + `chi` as Total from <table_name>
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!

  • 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,301
    Thanks
    57
    Thanked 525 Times in 512 Posts
    Blog Entries
    5
    No worries!
    See my new CodingForums Blog: http://www.codingforums.com/blogs/tangoforce/

    Many useful explanations and tips including: Cannot modify headers - already sent, The IE if (isset($_POST['submit'])) bug explained, unexpected T_CONSTANT_ENCAPSED_STRING, debugging tips and much more!


  •  

    Posting Permissions

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