CDbCommand failed to execute the SQL statement: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
then i change to:
$this->dbConnection->createCommand("UPDATE users SET status = 0 WHERE users.id = {$this->id} LIMIT 1")->execute();
everything is OK!
but both of them can change the data in mysql right。。the first way return error,why?
I only add this to my relations funtion, but I can't understant why the yii want to INSERT a record to the users_has_roles table! And how can I avoid this?