cuzzmunger Posted June 2, 2011 Share Posted June 2, 2011 Hi Freaks, You guys helped me yesterday & now I have expanded on what I was doing & now need more help. From my limited knowledge I'm trying to add theses strings together. (I'm a printer) Its all adding up correctly until the end. *$row['markup'] is only multiplying the last string and not the complete echo...I have indicated the last string in blue. <?php echo ($row['laminating']*$row['qty'])+($row['Stock1']*$row['qty'])+($row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover'])*$row['markup'];?> What I need to do is add up everything in red and * by my markup value (12%) <?php echo ($row['laminating']*$row['qty'])+($row['Stock1']*$row['qty'])+($row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover'])*$row['markup'];?> any help would be appreciated! cuzzmunger Quote Link to comment https://forums.phpfreaks.com/topic/238170-echo-help/ Share on other sites More sharing options...
Pikachu2000 Posted June 2, 2011 Share Posted June 2, 2011 The whole expression to be multiplied needs to be enclosed in parentheses. <?php echo ( ($row['laminating']*$row['qty'])+($row['Stock1']*$row['qty'])+($row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover']) )*$row['markup'];?> Quote Link to comment https://forums.phpfreaks.com/topic/238170-echo-help/#findComment-1223907 Share on other sites More sharing options...
cuzzmunger Posted June 2, 2011 Author Share Posted June 2, 2011 Thank You. Tested & working Quote Link to comment https://forums.phpfreaks.com/topic/238170-echo-help/#findComment-1223908 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.