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.

Thanks Saritha,

that worked.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.