i am trying to mutiply and add 2 dnamic texts on a php form, but i do not seem to get the reply, but i get the following results

"sum (4 + 1)"

This is the code that i typed in (<?php echo $row_standings['w']; ?>+<?php echo $row_standings['d']; ?> The 4 is the result of `w` and 1 is the result of `d`

I would like the that two figures add up on the screen, i also need to multiply other dynamice texts.

8 Years
Discussion Span
Last Post by dragon@dragon64

This looks to be more of a PHP question than a MySQL question, but I think I can help. I would assign the results to variables in php and then simply add them. Like so:

$w = $row_standings['w'];
$d = $row_standings['d'];
$sum = $w + $d;
echo "$w + $d = $sum";

This can work with multiplication too, just change the + to a *.

Hope this helps,
darkagn :)

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.