CGridView and CDbCommand/SQL

Hello All, Help me to solve an issue with CGridView. While I’m populating table record using CGridView, this is working well but when I filtering record using filter then I got some mistakes. The mistake is, there is a integer field in a table but in CDbCommand.query command it comparing as string using like keyword. See here, this is from my log


 2012/02/27 11:47:52 [profile] [system.db.CDbCommand.query] begin:system.db.CDbCommand.query(SELECT * 

FROM `tbl_event_training` `t` WHERE (client LIKE :ycp0) AND (active=:ycp1) LIMIT 30. Bound with :ycp0='%1%', :ycp1='1') 

Above field client (:ycp0) is an integer field but it comparing using string. How can I tell CGridView to use this as integer

Also I found other SQL:





SELECT COUNT(*) FROM `tbl_user` `t` WHERE active LIKE '%1%'



Where active is tinyint(1) field, which holds only 1 or 0

Thanks

Check your search() function in your model, probably have compare(‘attribute’,$this->attribute, TRUE); <— remove true

Thanks, It solved