I am trying to create an array which will follow something like this
array(
[Matt => 3],
[Tom => 7]),
//etc
)
I want this set up so I can use it with a mysql_fetch_assoc() such as
$i=0;
while($data = mysql_fetch_assoc($query)){
$Array[$i] = $data['name']; // sore name as part of array
$Array[$i][0] = ($data['number']; // keep number with the name.
$i++;
}
This does not work . I was unable to do so with a array_push. Can someone please guide me? Is my array declaration wrong or even important?