I'm creating a football betting game in PHP/MSQL and right now im trying to calculate the scoring system with if-statements.
the bets are saved per team like this:
Team 1: Bayern Munich
Team 2: Borussia Dortmund
Bet_Team1: 4
Bet_Team2: 1
The actual results:
Bayern Munich 5:2 Borussia Dortmund
saved like this:
Result_Team1: 5
Result_Team2: 2
I tried this with if statements:
// Completely right draw:
if($Bet_Team1 === $Result_Team1 && $Bet_Team2 == $Result_Team2){
$points = $points+6; }
It works well, but i don't know how to calculate the points, if the user bets the right winner team like in the example above with Bayern Munich and Borussia Dortmund.