Jump to content

Multiplying Variables


topflight

Recommended Posts

I have 2 variables a

nd they are not multiplying. here is what my code looks like:

if($rank =='CATI'){$hourly='1,500';}elseif($rank == 'CATII'){$hourly == '2,500';}elseif($rank == 'CATIII'){$hourly == '4,500';}elseif($rank == 'CATIV'){$hourly ='8,000';}elseif($rank =='CATV'){$hourly ='10,000';}


$pmoney = $rr["money"];

$money = "$hourly" * "$dur";
$finalcut = "$money" + "$pmoney";

 

Also the $pmoney is part of a mysql_fetch_assoc but the problem I am having is that $money is not multiplying please help.

 

Thanks in advanced

Link to comment
Share on other sites

My current code looks like this

if($rank =='CATI'){$hourly='1500';}elseif($rank == 'CATII'){$hourly == '2500';}elseif($rank == 'CATIII'){$hourly == '4500';}elseif($rank == 'CATIV'){$hourly ='8000';}elseif($rank =='CATV'){$hourly ='10000';}

$money = $hourly * $dur;
$finalcut = $money + $pmoney;

 

 

And it is still not doing the math correctly I am getting 0 for the $finalcut

 

 

And just and FYI the dur is a decimal number like 2.5

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.