
July 11th, 2002, 11:13 AM
|
|
|
|
Join Date: Apr 2007
Location: Perth, Australia
Posts: 221
Time spent in forums: < 1 sec
Reputation Power: 2
|
|
|
Addind some results
okay, i'm making a football tipping program, and am having some problem with one of my scripts.
php Code:
Original
- php Code |
|
|
|
<?php . . . . //find users points. $resultxx = mysql_query("SELECT * FROM FT_table, members WHERE round = '{$_POST['round']}' AND member_id = ID") $resultx = mysql_query("SELECT * FROM FT_results WHERE round = '{$_POST['round']}'") //determine how many tips they got correct $correct = 0; if($rowxx['game1'] == $rowx['game1']) { $correct += 1; } if($rowxx['game2'] == $rowx['game2']) { $correct += 1; } if($rowxx['game3'] == $rowx['game3']) { $correct += 1; } if($rowxx['game4'] == $rowx['game4']) { $correct += 1; } if($rowxx['game5'] == $rowx['game5']) { $correct += 1; } if($rowxx['game6'] == $rowx['game6']) { $correct += 1; } if($rowxx['game7'] == $rowx['game7']) { $correct += 1; } if($rowxx['game8'] == $rowx['game8']) { $correct += 1; } //insert the amount of correct answers they got. mysql_query("UPDATE members SET FT_points = FT_points + '$correct' WHERE ID = '{$rowxx['member_id']}'") ?>
it sort of works, it does exactly what i need, but only for the first person in the members list. I need it to look at everyones guesses, and then compare them to the results, not just one person. I know i gotta put a loop in there somewhere, but i'm too tired at the moment to see where :S. Any ideas?
|