Jump to content

echo help


cuzzmunger

Recommended Posts

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

Link to comment
https://forums.phpfreaks.com/topic/238170-echo-help/
Share on other sites

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'];?>

Link to comment
https://forums.phpfreaks.com/topic/238170-echo-help/#findComment-1223907
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.