Home > Back-end >  going through arrays PHP
going through arrays PHP

Time:05-03

I want know how i can extract the next 'team_name' from an array (30 difrent names) i know its probably simple, but I am beginer

when i using .$row0[$p]['team_name']. im geting this Warning: Trying to access array offset on value of type null in

$row0 = mysqli_fetch_array($sth0);
for ($i=1; $i <= $row['number_of_grups']; $i  ) 
{ 
    echo "<div class='grup'> <p> GRUPA ".$i." </p>";
    for ($a=0; $a < $teams_for_grup; $a  ) 
    {
        $team_input_name = "Druzyna" . $team_number_for_grups;
        $team_number_for_grups  ;
        echo "<div class='teams'><a>".$row0['team_name']."</a><input type='number' class='points-box' name='".$team_input_name."' value='".$row0['points']."'</div>";
    }
    echo "</div>";
}

CodePudding user response:

Without seeing the array for sure it will be hard to tell, but based off what I see here it looks like you would want to be doing: $row[$a]['team_name']

  • Related