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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.