Bug Report #4481

DB::select()->as_assoc()->execute() has no affect.

Added by mike trotta almost 3 years ago. Updated almost 3 years ago.

Status:ClosedStart date:03/20/2012
Priority:NormalDue date:
Assignee:-% Done:


Target version:-
Resolution:worksforme Points:1


DB::select()->as_assoc()->execute() returns the same result as DB::select()->execute()

The best way to get true array returned is DB::select()->execute()->as_array();

Sorry if this is not a bug... but one of those expected behaviors that I don't comprehend Like ORM objects that dont get returned as arrays either.

Kohana 3.2.0


#1 Updated by Dmitry T. almost 3 years ago

This is not a bug. The difference is as follows:

$result = DB::select()->as_assoc()->execute();
echo $result[0]['col'];

// vs

$result = DB::select()->as_object()->execute();
echo $result[0]->col;

#2 Updated by Jeremy Bush almost 3 years ago

  • Status changed from New to Closed
  • Resolution set to worksforme

Also available in: Atom PDF