从MySQL查询将多个列值存储到PHP数组中

I currently have an array that stores the values of one column from the database and that works fine however I want to store more than one column value. So in my example I want a team and their venue stored in the same array index. I can't seem find a way to do this.

If anyone can perhaps help that would be much appreciated.

Do you mean something like this?

$i = 0;
$my_array = array();

while ($row = mysql_fetch_assoc($result))
{
    $my_array[$i]['name'] = $row['names'];
    $my_array[$i]['otherfield'] = $row['otherfield'];
    $i++;
}

now you can do something like this

echo $my_array[2]['name'];

Simply do :

$rows = [];
while($row = mysql_fetch_assoc($result)) {
    $rows[] = $row;
}