$some_values = array(1,2,3,4,5);
Yii::app()->getDb()->createCommand('SELECT x FROM y WHERE z in (:p1)')->bindValuesForInClause(':p1'=>$some_values)->queryAll();
Page 1 of 1
Cdbcommand binding array for SQL IN clause
#1
Posted 01 June 2012 - 05:52 AM
I want to have something like
#2
Posted 01 June 2012 - 06:26 AM
use findAll()
Rajith Ramachandran,
Wiwo inc.
| Mobile: 919995504508
Wiwo inc.
| Mobile: 919995504508
#4
Posted 01 June 2012 - 09:31 AM
If you can use the query builder, http://www.yiiframew...bCommand#where()-detail
#5
Posted 02 June 2012 - 12:38 AM
vitman, on 01 June 2012 - 05:52 AM, said:
I want to have something like
$some_values = array(1,2,3,4,5);
Yii::app()->getDb()->createCommand('SELECT x FROM y WHERE z in (:p1)')->bindValuesForInClause(':p1'=>$some_values)->queryAll();
Maybe idea from Stackoverflow will be helpful.
#6
Posted 04 June 2012 - 10:03 AM
Thanks for replies.
BUT is this will not be useful if yii will do it automatically?
BUT is this will not be useful if yii will do it automatically?
Share this topic:
Page 1 of 1

Help














