xwishmasterx Posted April 6, 2011 Share Posted April 6, 2011 I was wondering how to write something like this: if (table1.column1 + table2.column2 > table3.column3 then ..... I am confused where to put ( ) and ' Link to comment https://forums.phpfreaks.com/topic/232898-simple-calculations-using-database-values/ Share on other sites More sharing options...
3raser Posted April 6, 2011 Share Posted April 6, 2011 Something like this? $total = table_col1 + table_col2 + table_col3; echo $total; EDIT: if(table_col1 + table_col2 + table_col3 == 20) { echo "adds up to 20 exactly"; } else { echo "does not equal"; } Link to comment https://forums.phpfreaks.com/topic/232898-simple-calculations-using-database-values/#findComment-1197828 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.