Calculated field

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tsinar
Forum Newbie
Posts: 2
Joined: Wed Nov 04, 2009 10:43 am

Calculated field

Post by tsinar »

Newbie to php - Suppose there are 5 fields; field1, field2, field3, field4 and field5.

Fields 1-4 are numeric values.

How do I make field5 the sum of the other 4 fields?

Thanks.
tsinar
Forum Newbie
Posts: 2
Joined: Wed Nov 04, 2009 10:43 am

Re: Calculated field

Post by tsinar »

Sorry to be unclear. Mysql database - Students receive scores in 4 categories based on their performance. The categories (which are fields in the table) are Knowledge of Music, Musicianship, Tone and Diction. Judges enter the score in each category;

Knowledge of Music - 40
Musicianship - 25
Tone - 25
Diction - 10

Based on that entry, the total score is calculated and the field contents updated with the result.

Total Score - 100

The problem I'm trying to avoid is with judges adding their category scores incorrectly.

Thanks for your help.
Post Reply