data grabbing and mathematics!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have 23 tables, well I have more but these 23 tables
are the main agenda regarding this question.

In each of the table is a column titled "score" and a
column titled "nickname" ... These are the two columns
we need for this.

Now lets throw a few names so you understand my needs.
 Lets say Bob, Bill and Barry are the "nickname"'s ...

Nickname:      Score:
Bob            5 
Bill           3
Barry          7

Okay lets say this is in a table titled "1".

Now in table titled "2" ....

Bob          3
Bill         4
Barry        6

Now I want the scores added up.  So using the + not *
(times) but just adding.  So for Bob is 5 + 3 = 8 and
this figure must than be placed in another table with
that name.

What I want to do is just have one code written up so
I don't need to change it.  So in other words the code
would include all 22 tables and the method to add each
other together and update to the actual main scoring
table.

So the score aRE updated once a week.  I don't mind if
I need to trigger the update (preffered) from a php
page/script.  That's not the problem but I want to
know what code I would use to grab these details and
add them up using all 22 tables in the one script.  So
each time the script is ran it will re-calculate all
tables to make sure they are correct if an update is
made to a score.

So the script would grab all 22 tables score and
nickname and than match the nickname and update their
score in the scoring table.

What I have is this:

My Tables are round 1 through to round22 and the
scoring totals go into table called tipping.

So round1 through to 22 need to be calculated and
keeping the totals for each nickname correct with
their totals.  Don't want the scores to be jumbled
with a different nickname.

How would I do this that would be a pretty fast
process and reliable?

If you need more information please let me know.  Each
round table will have identical Nicknames in each,
none will have more or few, same amount.

Keeping in mind each round that has not had a total
set is defaulted as nothing in the score field, it's
blank.  But if it's required to have a value of 0 in
there for the calculations to work I can default this
in.

If anyone can help me here it would be great, I have
been stuck on this for a while.  There is only going
to be like 15 names max in each round to do totals for
so it's not a huge database.  

Thanks for your time.

Jerry

Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux