tags:

views:

21

answers:

0

Hello,

I have written this method in a Model:

public function get_users()
{
    return DB::select('*')->from("users")->as_object()->execute();
}

Then I have written this in a controller:

$model = New Model_Test();

$users = $model->get_users();

How should I do to retrieve the values in this way? Is it possible?

foreach ($users as $user){
            echo $user->name;
            echo $user->email;
        }