yii查询语句输入中文报错
上面是yii自身的登录页面
我将UserIdenity.php中的authenticate()方法改为如下:
public function authenticate()
{
$model= User::model()->find("username=:username",array(":username"=>$this->username));
if(!isset ($model))
$this->errorCode=self::ERROR_USERNAME_INVALID;
elseif($model->password!==md5 ($this->password))
$this->errorCode=self::ERROR_PASSWORD_INVALID;
else
$this->errorCode=self::ERROR_NONE;
return !$this->errorCode;
}
在登录过程中发现如果输入中文会报错。求解决方案