Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
だからこれは働いています:
DB::select()->from('images')->execute()->as_array();
しかし、私は自分のビューで配列が好きではありません (余分な 2 文字) オブジェクトを使用したいです。どうやってやるの?
DB::select()->from('images')->as_object()->execute();
これはエラーを引き起こしています。
元の質問に対する私のコメントとは別に、実行されたクエリは、Database_Resultforeached可能なオブジェクトを返し、各行のstdClassオブジェクトを返す必要があります。
Database_Result
以下を使用できます。
DB::select()->from('images')->as_object()->execute()->as_array();