I have rows in my teams table named player1, player2, player3 ... player12. In PHP script i set them as variables ($player1,$player2...) and want to loop through them to check if they are NULL, and if they are not to count them.
How may I increment a variable in PHP? I have tried doing it likes this:
<?
$playerspicked = 0;
for($i = 1; $i <= 12; $i++) {
$playercheck = "$player"+$i;
if($playercheck != 0) {
$playerspicked++;
}
}
?>
but this wouldn't work.