I have a database table (QUEUE) like this:
queueId phoneNumber
1 340 000
1 340 111 1
1 340 222
2 332 000
2 332 111
3 421 000
3 421 111
3 421 222
I use this query:
SELECT * FROM queue ORDER BY queueId
and this php code:
while ($rowQueue = mysql_fetch_array($resultQueryQueue, MYSQL_ASSOC)) {
$queue[] = array(
'queueId' => $rowQueue['queueId'],
'phoneNumber' => $rowQueue['phoneNumber']
);
}
result is a array with 8 arrays (beacuse record are 8).
I would like to get an array that contains arrays as there are so many keys. In my example I would like to get 3 arrays, the first key 1, the second and the third with key 2 and key 3.
How can I make PHP? Is there any function that can help me?