[Solved] Problem with select

I have one problem with the creation of a Select Condition or CDbCriteria object via usage of the Yii functions.

My problem is I have several Search Condition (which aren't static)


I have easy Selects like this:

SELECT ID, Company, Address1, Address2, Address3, City, Country 

FROM `tbcompany` 


(`tbcompany`.`Address1` LIKE '%searchstreet%' OR 

`tbcompany`.`Address2` LIKE '%searchstreet%' OR 

`tbcompany`.`Address3` LIKE '%searchstreet%')

 AND (`tbcompany`.`City` LIKE '%heidelberg%')

The seperated Condition for each Searchpattern Part are created with usage of the createSearchCondition Funktion:


Where $columns and $keywords for each part would look like this:

$columns: array('0'=>'Address1', '1'=>'Address2', '2'=> 'Address3');


$columns: array('0'=>'City')

$keywords: array('0'=>'heidelberg')

But how can I create a search Condition for an Column of Type integer


`tbcompany`.`ID` IN (28, 29, 30)

I knew that I can create this condition with


If the column of interest is the Primary Key but what if its a normal integer colum ?

Am I only blind to see the function?

Please helpĀ  ???

Btw I collect all my conditions in an array "$condition_array" and combine them via the code below and create the full sql string or using the findAll method.

$criteria=new CDbCriteria;

$criteria->condition=implode(' AND ',$condition_array);


$firephp->log($criteria, '$criteria');



$firephp->log($sql, '$sql');




In the upcoming 1.0.4, there's a createInCondition() that you can use.

thats what I wanted to hear ;) I really wondered if I am only blind or stupid.

Is it available in the current svn version?

Thanks I have itĀ  ;D

Tested it and it works perfectly as expected