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.
General
Undefined index when performing query
JeanAlesi
August 2015
What does the error "
Fuel\Core\PhpErrorException [ Notice ]:
Undefined index:
" mean?
It happened when running this function:
$groups = Model_Tmgroup::query()
->where('owner_id', '=', $user_id)
->related('tmfriends')
->get();
atabak
August 2015
Accepted Answer
if
owner_id in
tmfriends relation, you must use
$groups = Model_Tmgroup::query()
->related('tmfriends')
->where('
tmfriends.
owner_id', '=', $user_id)
->get();
Harro
August 2015
PHPErrorException's are standard PHP errors that are wrapped in an exception so they can be caught and handled. So this is a standard PHP notice.
And it should tell you exactly where in the code it happens, in development mode exceptions are shown with a backtrace with code snippets.
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
atabak
August 2015
Harro
August 2015