I'm using PHP and Microsoft SQL 2003.
I have this table:
Page | Group
------------
1 | 1
2 | 2
3 | 1
4 | 2
I need to get an array grouped by "Group":
Array(
1 => Array(1, 3),
2 => Array(2, 4)
);
I am using PDO, I'd like to get the array directly from SQL instead of parse the entire result with a PHP loop.
How can I do?