时间:2021-07-01 10:21:17 帮助过:24人阅读
?Resource?id?#6 分享到:
function Query($id="me",$sql='')
{
$this->Execute($id,$sql);
}
function Execute($id="me", $sql='')
{
global $DB;
if($DB->isClose)
{
$this->Open(false);
$DB->isClose = false;
}
if(!empty($sql))
{
$this->SetQuery($sql);
}
//SQL语句安全检查
if($this->safeCheck)
{
CheckSql($this->queryString);
}
$this->result[$id] = mysql_query($this->queryString,$this->linkID);
if($this->result[$id]===false)
{
$this->DisplayError(mysql_error()."
Error sql: ".$this->queryString."");
}
}
function DisplayError($msg)
{
$errorTrackFile = dirname(__FILE__).'/../data/mysql_error_trace.inc';
if( file_exists(dirname(__FILE__).'/../data/mysql_error_trace.php') )
{
@unlink(dirname(__FILE__).'/../data/mysql_error_trace.php');
}
$emsg = '';
$emsg .= "Error Warning!
\r\n";
$emsg .= "\r\n";
$emsg .= "
Error page: ".$this->GetCurUrl()."\r\n";
$emsg .= "Error infos: {$msg}\r\n";
$emsg .= "
\r\n";
echo $emsg;
}
?>