This could work, and I did look at this, but with the default arguments it adds ‘%’ to the front and back of the value, which is not the intended result. You could use something like this:
but all the addSearchCondition does is add a new condition with “$column LIKE :ycp3”, then add a param of $params[’:ycp3’] = $acc, so he’s doing the same thing it does already. I don’t think that’s really the problem.
I’m going to say that using a concat in the query is a hack. PDO is designed so you don’t have to do that. If you have do that, then there is something else wrong somewhere (and that something may even be a bug in the PDO driver).
From everything I see, what he is doing should work fine.
Can you give us the entire code snippet where you are using the criteria? I just did some testing on my box and it looks like what your doing should work…
Thank you very much to all of you for the best feedback and responses.
The query is work okay, the problem is with the pagination ;( But, I like use your suggestion (addSearchCondition). You are right. If we use php hack then what would be the point of using Yii? I understand that Yii may not have the feature we need, but then it is our task to make it available.
I realize this is a relative old topic, but I thought I should post the solution I found, which I believe is better. In your case the conditions could be written like this