Jump to content

Archived

This topic is now archived and is closed to further replies.

jd|

Manipulating table data

Recommended Posts

Hi I’m creating a site for my golf society and I have come to a stand still and am unsure on how to continue.

I have a form that inputs a score for each member this is recorded in a table along with the course id. When all the data is entered I need to adjust everyone’s handicap based on certain rules the handicap is stored in a different table. i.e

· The winnings handicap has 2 strokes deducted from their handicap
· Anyone with more than 36 points has 0.5 deducted from their handicap
· Anyone three points below the winner will receive 0.1 onto their handicap
· Anyone six points below the winner will receive 0.2 onto their handicap.

The problem is I think I can write the “if else” statements to cover all the eventualities but I have no clue on how to loop the data through the loop.

Any help would be greatly appreciated.

JD

Share this post


Link to post
Share on other sites
This is in a database, right?

If so, you can update with SQL statements:

$query = "UPDATE scoring_table SET handicap = handicap + .1 WHERE userid = x"

Share this post


Link to post
Share on other sites
Yes its mysql. But the problem I have is the query to excute all the members table one after each other  and the if events for this

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.