2012-11-07 39 views

回答

2

是否要獲得一組名稱,如array(0 => 'John', 1 => 'Sam')

您應該致電$names = $gry1->as_array(NULL, 'name');

+0

謝謝!正是我在尋找的東西。 –

1

http://kohanaframework.org/3.3/guide/database/results#select-asobject-and-asassoc

方法as_assoc()將刪除對象名稱和返回 結果重新設置爲關聯數組。由於這是默認設置,因此這種方法很少需要 。

所以只要做你的執行。

但是,如果你只想要一行看看current()方法。

+0

對不起,這不是我想要的......我編輯了我的問題並舉了一個例子。感謝您的回覆:) –

相關問題