我正在尝试使用PDO获取一个看起来像这样的数组:
{
university A {
year 1 {
course 1: 10
course 2: 20
...
}
year 2 {
course 1: 15
course 2: 20
...
}
...
university B {
year 1 {
course 1: 10
course 2: 20
...
}
year 2 {
course 1: 15
course 2: 20
...
}
...
}
MySQL输出如下:
uni name year course name number
University A 2014 course_1 10
University A 2014 course_2 18
University A 2015 course_1 15
University A 2015 course_2 20
University B 2014 course_1 10
University B 2014 course_2 18
University B 2015 course_1 15
University B 2015 course_2 20
有没有办法用这个MySQL结果用PDO创建一个三维数组,还是应该用PHP来创建数组呢?