时间:2021-07-01 10:21:17 帮助过:10人阅读
public function prepare()
{
if($this->_statement==null)
{
try
{
$this->_statement=$this->getConnection()->getPdoInstance()->prepare($this->getText());/**************就是这行报错******************/
$this->_paramLog=array();
}
catch(Exception $e)
{
Yii::log('Error in preparing SQL: '.$this->getText(),CLogger::LEVEL_ERROR,'system.db.CDbCommand');
$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;
throw new CDbException(Yii::t('yii','CDbCommand failed to prepare the SQL statement: {error}',
array('{error}'=>$e->getMessage())),(int)$e->getCode(),$errorInfo);
}
}
}