I have the following query:
$query = "SELECT *
FROM mytable
{$typeClause}
HAVING distance <= {$radius}
ORDER BY distance ASC"
GROUP BY type;
$result = db_query($query);
$points = array();
while(($point = $result->fetchAssoc()) != null){
}
In my db there is field 'type' which is a number
How can I get all records as an array without using the while statement above (something like fetchByGroup):
array(
'1' => array( [all records of type=1] ),
'2' => array( [all records of type=2] ),
......................................
);