我写了一个$this->db->query('end');但是报sql语句错误.
functionquery($sql,$type='')
{
if($this->link_ id===NULL)
{
$this->connect($this->settings['dbhost'],$this->settings['dbuser'],$this->settings['dbpw'],$this->settings['dbname'],$this->settings['charset'],$this->settings['pconnect']);
$this->settings=array();
}
if($this->queryCount++queryLog[]=$sql;
}
if($this->queryTime=='')
{
if(PHP_VERSION>='5.0.0')
{
$this->queryTime=microtime(true);
}
else
{
$this->queryTime=microtime();
}
}
/*当当前的时间大于类初始化时间的时候,自动执行ping这个自动重新连接操作*/
if(PHP_VERSION>='4.3'&&time()>$this->starttime+1)
{
mysql_ping($this->link_id);
}
if(!($query=mysql_query($sql,$this->link_id))&&$type!='SILENT')
{
$this->error_message[]['message']='MySQLQueryError';
$this->error_message[]['sql']=$sql;
$this->error_message[]['error']=mysql_error($this->link_id);
$this->error_message[]['errno']=mysql_errno($this->link_id);
$this->ErrorMsg();
returnfalse;
}
if(defined('DEBUG_MODE')&&(DEBUG_MODE&8)==8)
{
$logfilename=$this->root_path.DATA_DIR.'/mysql_query_'.$this->dbhash.'_'.date('Y_m_d').'.log';
$str=$sql."nn";
if(PHP_VERSION>='5.0')
{
file_put_contents($logfilename,$str,FILE_APPEND);
}
else
{
$fp=@fopen($logfilename,'ab+');
if($fp)
{
fwrite($fp,$str);
fclose($fp);
}
}
}
return$query;
}
这是那么query方法,请各位高手帮我看看哪里错了~