CDbCommand failed to execute the SQL statement: SQLSTATE[HY093]: Invalid parameter number: number of bound variables does not match number of tokens. The SQL statement executed was: SELECT * FROM `tbl_user` `t` WHERE `t`.`username`=:yp0 LIMIT 1
Thanks Bjorn, but I read that topic before but no change to my knowledge
It’s not documented clearly but CActiveRecord::findByAttributes() takes care of parameter binding (in fact, it delegates the job to CDbCommandBuilder::createColumnCriteria()). You need to use third parameter only when second parameter (the additional condition) is not empty.