I am wondering if this is possible.
I have a table with three columns (there's an id column too, but irrelevant here):
[year] [month] [price]
How do I generate an array that consolidates year and month?
Result would be like this:
[
2011 => [Jan => price, Feb => price, etc.]
2012 [Jan => price, Feb => price, etc.]
]
Any way to this directly with PDO, instead of looping and creating it with PHP?
I've tried the FETCH GROUP fetch mode, but haven't been successful.