So many questions about PDO::fetchAll() but still I can't find my answer. I need to fetch my results as it is returned by the MySQL. for example if I have columns id
, name
, age
to be returned like this:
array(
"id"=array(1,2,3),
"name"=array("xy","by","cy"),
"age" = array(32,34,35)
)
I know I can make a function and iterate through the list and put them in the array manually, but I want to know if there is a direct way using fetchAll('magic').