954,600 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

formulas with Mysql dynamic texts

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.

dragon@dragon64
Light Poster
37 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

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

darkagn
Veteran Poster
1,197 posts since Aug 2007
Reputation Points: 404
Solved Threads: 200
 

thank your reply was very helpful. solved my issue

dragon@dragon64
Light Poster
37 posts since Oct 2007
Reputation Points: 10
Solved Threads: 0
 

This question has already been solved

Post: Markdown Syntax: Formatting Help
You