Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
No Results when trying to use WHERE
Hey Guys, Ok so if I use Model_Question_Set::find("all"); I can all the results, great! Now I want to filter than and get only the rows that are related to a specific set, so if I try and run: Model_Question_Set::find()->where('question_set', "a"); I get no results?? Is there are way to print the query that gets made to do the ORM selection or something like that ?
Is it maybe my field name on the table that is and issues because of underscore, although I don't see why that should be ? Thanks.
Did you put ->get() at the end? You need to tell the query to execute, otherwise you're left with just a Orm\Query object.
Interesting, I didn't see that in the ORM section of the Documentation at the bottom where it tells how to deal with where clauses. So how come if you just do a find("all) it works without adding ->get() ?
Or is that just a quirk of the fuelPHP framework ?
You use either direct querying by using find() with params or you use method chaining which needs an explicit execute. All of this is pretty well illustrated by well commented examples in the docs:
Add a Comment
It looks like you're new here. If you want to get involved, click one of these buttons!
Apply for Membership
↳ Job Board
↳ Installation & Setup
↳ Tips and Tutorials
↳ Code share
In this Discussion