Bug Report #4481

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

Added by mike trotta over 2 years ago. Updated over 2 years ago.

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

0%

Category:Modules:Database
Target version:-
Resolution:worksforme Points:1

Description

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

History

#1 Updated by Dmitry T. over 2 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 over 2 years ago

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

Also available in: Atom PDF