So I am trying to accomplish something like this:
SELECT * FROM table WHERE status_id IN (1,3,4);
using Zend_Db_Select... can't find how to do it :( Is it at all possible?
So I am trying to accomplish something like this:
SELECT * FROM table WHERE status_id IN (1,3,4);
using Zend_Db_Select... can't find how to do it :( Is it at all possible?
you can also use it like this:
you dont need to implode array, and it's safer
or
The first answer probably works in ZF1 but it doesn't work in Zend Framework 2:
In case the Zend Framework2 I found out that you have to use:
Result:
I couldn't find this documented anywhere! ZF documentation is generally sub-optimal.
apparently it is super simple... stupid me:
:(
We can use
Zend\Db\Sql\Predicate\In
withZend\Db\Sql\Where
to make a where in query inside a model.