Jump to content

echo help


cuzzmunger

Recommended Posts

Hi freaks,

Yes im a noob...

 

I have some data in a db that im echoing out, but the last row wont multiply? The rest works great...

I have tried having the data as the following: 1.12 or 0.12 & I have tried having it as a var.

 

Do I need to have a % in there somewhere? Im adding up all the data then I want to multiply by 12% (*$row['markup'])

 

 

<?php echo $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/238062-echo-help/
Share on other sites

Thanks for the reply,

the maths below:

 

0.50*100+30+30+5+5+5*12%=140

 

is the same as

 

Stock1*qty+cutting+production+additional+pluscover+selfcover*markup= total price

 

the result i get is 125 so its not doing the last multiply (*$row['markup'])

 

I just want to add it all up then *12%

 

<?php echo $row['Stock1']*$row['qty']+$row['cutting']+$row['production']+$row['additional']+$row['pluscover']+$row['selfcover']*$row['markup'];?>

 

I only tried the var like this instead of taking it from the database

$markup_var = 1.12;

 

then I added ...........$row['selfcover']*$markup_var

 

cheers

 

Link to comment
https://forums.phpfreaks.com/topic/238062-echo-help/#findComment-1223357
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.