假设我们有这个 MySQL 表
name value
author Sabriel Armstrong
author Peter Abhorsen
author Garth Stein
item bell
item book
item sword
item wand
鉴于这些数据库条目,有没有办法检索这些值以获取以下格式?还是我的数据库建模错误?
array(
[author] => array(Sabriel Armstrong,Peter Abhorsen, Garth Stein),
[item] => array(bell,book,sword, wand)
)