I have a simple sql statement which adds up all the numbers in one colum of my database, the code I used is
$sql ="SELECT SUM(cost) as 'cost' FROM results WHERE resultid = '$resultid'"; $sql = @mysql_query($total,$connection) or die(mysql_error());
As well as the colum "cost" I also have another colum in my database called "costtwo"
How can I get the statement to add these two coloums (cost + costtwo) and then total the rows up? Basically like it does now, but adding costtwo before it tots up the rest of the values
Is this easy?