I'm trying to use the sum() function. I am using php with mysql. I have a column named "paid". Each value in the field is 'yes', 'yes2', yes3'. I want to add different values to these for example:
if($paid == "yes")
{$paid = 10;}
if($paid == "yes2")
{$paid = 15;}
if($paid == "yes3")
{$paid = 20;}
What I am trying to do is call up all there values from the "paid" column and then get a grand total of what they are together. For example if I call up "yes" and "yes2" the total would equal 25. I hope this makes sense. Would I call up all the paid values, then change their value to that of a nummerical value and then use the sum function? I can't seem to get this to work.