943,907 Members | Top Members by Rank

Ad:
  • MySQL Discussion Thread
  • Marked Solved
  • Views: 689
  • MySQL RSS
Mar 21st, 2009
0

formulas with Mysql dynamic texts

Expand Post »
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.
Reputation Points: 10
Solved Threads: 0
Light Poster
dragon@dragon64 is offline Offline
37 posts
since Oct 2007
Mar 21st, 2009
0

Re: formulas with Mysql dynamic texts

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:
php Syntax (Toggle Plain Text)
  1. $w = $row_standings['w'];
  2. $d = $row_standings['d'];
  3. $sum = $w + $d;
  4. echo "$w + $d = $sum";

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

Hope this helps,
darkagn
Reputation Points: 395
Solved Threads: 192
Veteran Poster
darkagn is offline Offline
1,136 posts
since Aug 2007
Mar 21st, 2009
0

Re: formulas with Mysql dynamic texts

thank your reply was very helpful. solved my issue
Reputation Points: 10
Solved Threads: 0
Light Poster
dragon@dragon64 is offline Offline
37 posts
since Oct 2007

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in MySQL Forum Timeline: Insert Unique to User...
Next Thread in MySQL Forum Timeline: MySQL database backup





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC