I have a table like this;
**Year** **Month**
2012 Jan
2012 Mar
2012 Apr
2013 Dec
2013 Nov
And I am trying to create an array from this table similar to below;
Array
(
[2012] => Array(
Jan, Mar, Apr),
[2013] => Array(
Dec, Nov)
);
so far I tried this code, but didn't get what I want,
while ($row = mysql_fetch_array($result)){
$new_array[] = array(
'year' => $row['year'],
'month' => $row['month'],
);
}