我正在尝试从codeigniter模型运行以下脚本
public function query_te($query){
$this->log_d->query($query);
$data = array();
if($this->log_d->_error_number()){
$msg = "MySQL error ".$this->log_d->_error_number().": ".$this->log_d->_error_message()."\nWhen executing <br>\n$query\n<br>";
$data['error'] = 1;
$data['msg']=$msg;
}else{
$msg = "Success";
$data['error'] = 0;
$data['msg']=$msg;
}
return $data;
}
我正在调用控制器
中的部分 $qry="ALTER TABLE page_ids CHANGE connected_user connected_user ENUM( 'CO', 'CON_s', 'CON', 'F', 'S' ) NOT NULL;";
$return_dat= $this->sql_mig->query_te($qry);
即使脚本执行正常并更改了db中的列结构,但仍然会出现如下错误:
MySQL error 1065: Query was empty When executing