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 Quote 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']; Quote Link to comment https://forums.phpfreaks.com/topic/247545-simple-math-question/#findComment-1271194 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.