MySQL query, SUM of multiple columns
mysql, php
Solution
Combined sum of all three columns?
If so, simply add them up:
'$query= "SELECT SUM(i100s) + SUM(i60s) + SUM(i25s) AS tkit FROM event WHERE acc='100' " ;
Problem
I have multiple columns in a mySQL table. Three of the columns are named i100s, i60s and i25s and what I want to do is get the sum of all three entries . currently I have this code ``` '$query= "SELECT SUM(i100s),SUM(i60s),SUM(i25s) AS tkit FROM event WHERE acc='100' " ; $result = mysql_query($query) or die(mysql_error()); $row = mysql_fetch_assoc($result) ; $total = $row['tkit'];' ``` But it is not returning the correct result.