esoteric Posted September 20, 2011 Share Posted September 20, 2011 What is the correct way to right a simple maths question i have my total as: <?php echo $row['total'];?> i have my another number as: <?php echo $row['user_credit']; ?> but what i want to do is subtract the user_credit from the total and save it as a new variable called 'credits_used' but im unsure how to write it do i do it like $row['total'] - $row['user_credit'] = $row['credit_used']; Thank for any help Link to comment https://forums.phpfreaks.com/topic/247545-simple-math-question/ Share on other sites More sharing options...
xyph Posted September 20, 2011 Share Posted September 20, 2011 $row['credit_used'] = $row['user_credit'] - $row['total']; Link to comment https://forums.phpfreaks.com/topic/247545-simple-math-question/#findComment-1271194 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.