我每次都会收到语法错误:
$skills = SubSkills::model()->findAll(array('order'=>'number DESC','condition'=>'number > 0 AND user_id=:user_id AND select = 0', 'params'=>array(":user_id" =>1),'offset'=>0,'limit'=>2,
));
如果我去掉"select = 0
" 部分就可以了。
这是错误:
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 'select < 1 ORDER BY number DESC' at line 1
我认为这是因为“SELECT”作为行名会与 MySQL 冲突。有没有办法逃脱呢?
谢谢!