Thanks again for your help.
I've tried implementing your suggestions but I am having the following difficulty...
The user predictions are all stored in one table, so for one set of predictions (10, for example) there could be 20 users' predictions for those 10 fixtures (meaning 200 rows).
The results table will only have the results in for those 10 fixtures, so only 10 rows will need to be retrieved from the that table.
The problem is arising while trying to compare the predictions vs the results, because the loop isn't working correctly due to 10 results being compared against 20 predictions (using 2 sets of user predictions as testing criteria at the moment).
Nesting the foreach loop inside the for loop is causing each single prediction to be compared against the 10 results, then it is repeated for every prediction in the table, and I don't know how to fix it.
Just spent literally 4 hours trying and haven't got very far at all, so if you could help solve it I would be very grateful please!
Here is my code in it's current state:
for($i = 0; $i < sizeof($predictions); $i++) {
$prediction = $predictions[$i];
reset($results);
foreach($results as $result) {
if ($prediction['score_1'] == $result['score_1'] && $prediction['score_2'] == $result['score_2'])
{
echo "correct score";
echo "<br />";
} // predicting score does not match resulting score
else
{
echo "incorrect score";
echo "<br />";
}
}
}
Which outputs something along the lines of... (snippet)
correct score
incorrect score
incorrect score
incorrect score
incorrect score
incorrect score
incorrect score
correct score
incorrect score
incorrect score
🙁
Thanks a lot.