I am creating a hobby soccer stats site. Here are some scores:
Player1 – Player2
- 5:1
- 5:2
- 0:4
- 0:1
For player1 I am trying to find the best and worst score with php. I tried a mysql_fetch_array with
$player1max = $row['MAX(player1)'];
however I get the score 5:2. However the correct score would be 5:1 as in this case player1 received only one goal.
The same happens with
$player1min = $row['MIN(player1)'];
I get 0:1, but I should get 0:4 (because getting 4 goals is worse then 1).
Just make the counter-goals extract from the make-goals and the result is either best or worst.
Example:
That way:
Worst score = -4 (0:4)
Best score = 4 (5:1)