Hello,

I am retrieving two values from a database. I want to get the result after addition of the two values. the code I used is

echo "$client <br> $prgno <br> $prgname <br> $trainername <br> $dates <br> $days <br> $proffee <br> $trainerfee <br> $reimbexp<br> $handoutchg <br> $invoiceno <br> $totalinvamt <br> $feerecd <br>";



$i++; }

$addition = "$proffee+$trainerfee";

echo "$addition";

The result is 1500+2000, but it is not outputting 3500

Please help.

try to use this one..

just remove double quotes here;
dont use double quotes for variables...

$addition = $proffee+$trainerfee;

echo $addition;

Hello,

I am retrieving two values from a database. I want to get the result after addition of the two values. the code I used is

echo "$client <br> $prgno <br> $prgname <br> $trainername <br> $dates <br> $days <br> $proffee <br> $trainerfee <br> $reimbexp<br> $handoutchg <br> $invoiceno <br> $totalinvamt <br> $feerecd <br>";



$i++; }

$addition = "$proffee+$trainerfee";

echo "$addition";

The result is 1500+2000, but it is not outputting 3500

Please help.

This question has already been answered. Start a new discussion instead.