Love Fuel?
Donate
About
Forums
Discussions
Login
FuelPHP Forums
Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Orm
How to access query results?
fl0w
June 2013
Hey! How can i access my query results
:/
? i have this query and if i try to echo the result it wont work in any way.
$res = Model_Ncard::query()->where('Nname', 'LIKE', '%'.$name.'%' )->or_where('Nname_DE', 'LIKE', '%'.$name.'%')->get();
foreach($res as $row)
{
print_r($row);
}
If im doing it with print_r i get a very strange result like shown below oO anyone get ideas?!?!
Model_Ncard Object ( [_is_new:protected] => [_frozen:protected] => [_data:protected] => Array ( [id] => 1 [Nid] => 3041 [Nname] => Aesthir Glider [Nset] ...etc
kenjis
June 2013
Accepted Answer
Don't worry, it an object. It is ok.
See, for example, $row->Nname
Add a Comment
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Apply for Membership
Categories
All Discussions
5,088
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
260
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52
In this Discussion
kenjis
June 2013