I'm trying to create a sort of multidimensional array which takes 2 values from a database and stores in into 1 index in the array
Example x[0] = Jille, 595
I'm doing this as such
while ($row = mysql_fetch_array($result2))
{
$opponents[] = $row['opponents'];
$fixId= array($row['fixture_id'] => $opponents) ; //Is this line correct??
}
Then later on in my code I want to use the $fixId array which should hold 2 values per index I do this as such:
foreach($fixid as $id => $oppname){
echo "<option value=\"$oppname\" >".$oppname;"</option>";
}
However it is not working the values $id and $oppname does not have a value or take on some strange value.
What am I doing wrong?
foreach ($opponents?