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.

Recommended Answers

All 2 Replies

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 :)

thank your reply was very helpful. solved my issue

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.