I really thought it was hard to implement the IN clause in Zend Db Select, but after a few research, it was very easy just like the other clause in the WHERE clause.
All you need is an array then pass it to where() just like any other parameters. The put the question mark inside the parenthesis of your IN clause.
//sample parameter, a numeric key array $params = array('3010001', '3010002', '3010003', '3010004'); //this example uses Zend_Db_Table $select = $table->select() ->where('Scan_Number IN(?)', $params); //the rest of the code
As simple as that.
great!
what if you have to escape your data? how would you do that?
@Jamie – Zend Framework will take care of that 😀
it works! zf 1.11
собственно, я так и думал))