Re:data grabbing and mathematics!
| From: | JeRRy | Date: | Tue, 08 Mar 2005 14:44:55 +0000 |
| Subject: | Re:data grabbing and mathematics! | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-38820@lists.php.net to get a copy of this message | ||
Okay I have this:
<snip>
$sql = "UPDATE round" . ($round_number -1) . " SET
score=score+1 WHERE $select='$winner'";
</snip>
Which works as it should.
Now after all that is completed how is the best way to
retrieve the nickname and the score in that round and
update another table?
Okay two tables, one is round5 (for instance) and the
other is tipping.
So ....
round5 table:
Nickname: Score:
Bob 5
Bill 4
Fred 3
So I want to grab each nicknames score and UPDATE the
tipping table.
tipping table:
Nickname: Score:
Bob 24
Bill 31
Fred 30
So we need to add 5 for bob and 4 for bill and 3 for
fred on top of their current score. So for instance
Bob would go to 29.
What is the best way to do this? I need the nicknames
round score to update their total score and be
reliable to update the right nickname.
This would solve a bit of my time mucking around and
re-structuring my database until I have more time. :)
If you need more information please let me know.
Jerry
Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com