我有一個簡單的數據庫表,看起來像這樣:http://www.xup.in/dl,17431410/screwed.jpg/現在我想在這看起來像ItemModel使用$this->find('all')
數據:CakePHP中找到搞砸了
public function getList() {
$data = $this->find('all');
pr($data);
exit;
}
輸出是
Array
(
[0] => Array
(
[Champion] => Array
(
[id] => 1
[name] => A
[key] => ahri
)
)
[1] => Array
(
[Champion] => Array
(
[id] => 2
[name] => A
[key] => akali
)
)
[2] => Array
(
[Champion] => Array
(
[id] => 3
[name] => A
[key] => alistar
)
)
[3] => Array
(
[Champion] => Array
(
[id] => 4
[name] => A
[key] => amumu
)
)
)
我完全不知道爲什麼這個名字在第一個字母處被刪除。
你應該提供數據庫方案 – mark 2012-03-20 15:41:19
對不起,這是它:http://www.xup.in/dl,16357143/schema.jpg/ – Fortuna 2012-03-20 15:46:46