Hello,
I am facing strange behavior when I try to delete a record in a table. my code is the following :
Account::model()->deleteAll(array(
'condition' => "`active` = ':active' AND (`name` LIKE ':name' OR `email` LIKE ':email')",
'params' => array(':active' => self::INACTIVE, ':name' => $name, ':email' => $email ),
));
- There is a record in accounts table that matches the condition, but it is not being deleted, even no errors has been thrown!
I have sql queries logging enabled, and I tried to see the executed query, and it looks like the following :
2010/04/09 17:36:06 [trace] [system.db.CDbCommand] Executing SQL: DELETE FROM `accounts` WHERE `active` = ':active' AND (`name` LIKE ':name' OR `email` LIKE ':email')
- Are the parameters not being bind? or the query is logged before binding parameters? if the second question has yes answer then how can I log the final generated query?
Firas.