Hello everybody,
this is what I have in my controller:
$sess = Yii::app()->session;
$model = isset($sess['lastSearch'])? $sess['lastSearch'] : new SearchForm;
and this is my model:
$c = new CDbCriteria;
if(!empty($this->number)) {
$c->compare('t.number', $code);
}
Everything works just fine. Now the customer asked me to introduce a wildcard, something like "123" or "12*345", so that he can search numbers like "start with" or "contains". So I did put in some logic, and still everything works fine, my logic works, but when the page reloads all the * are gone. Weird thing is that this happens only with the "number" field, all other fields will keep the * after the search. So this app is connecting to a MSSQL server, where the number field in my table is primary key and integer. I wonder if the framework or the db abstraction layer are somehow "sanitizing" my search string… how to debug this?
Thanks a lot