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
Problem with And where in ORM Query
Syntaxlb
July 2013
EDIT:
Fixed :
\Concours\Model_Concours::query()
->where('date_debut', '<=', \DB::expr('NOW()'))
->where('date_fin', '>=', \DB::expr('NOW()'))->get();
Thanks
---------------
Hi,
can you explain me why it's doesn't match result :
\Concours\Model_Concours::query()
->where('date_debut', '<=', 'NOW()')
->and_where_open()
->where('date_fin', '>=', 'NOW()')
->and_where_close()->get();
OR
\Concours\Model_Concours::query()
->where('date_debut', '<=', 'NOW()')
->where('date_fin', '>=', 'NOW()')
->get();
And this query work and match result :
\DB::query('SELECT *
FROM `concours`
WHERE `date_debut` <= NOW()
AND `date_fin` >= NOW()')->as_object('\Concours\Model_Concours')->execute()->as_array();
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,089
General
↳ General
3,364
↳ Job Board
13
↳ Installation & Setup
214
Packages
↳ Oil
213
↳ Orm
700
↳ Auth
261
Development
↳ Tips and Tutorials
126
↳ Code share
145
↳ Applications
52