php网站首页报错 Resource id #6
测试页面报错:
Error page: /index.php
Error infos: No database selected
Error sql: select * from c_seo where id=1
不知道问题出来哪里,有人帮我看下吗
$this->queryString 的值是select * from c_seo where id=1
$this->linkID 的值是Resource id #6
<br /> <?php<br /> <br /> function Query($id="me",$sql='')<br /> {<br /> $this->Execute($id,$sql);<br /> }<br /> <br /> function Execute($id="me", $sql='')<br /> {<br /> global $DB;<br /> if($DB->isClose)<br /> {<br /> $this->Open(false);<br /> $DB->isClose = false;<br /> }<br /> if(!empty($sql))<br /> {<br /> $this->SetQuery($sql);<br /> }<br /> <br /> //SQL语句安全检查<br /> if($this->safeCheck)<br /> {<br /> CheckSql($this->queryString);<br /> }<br /> <br /> $this->result[$id] = mysql_query($this->queryString,$this->linkID);<br /> if($this->result[$id]===false)<br /> {<br /> $this->DisplayError(mysql_error()." <br />Error sql: <font color='red'>".$this->queryString."</font>");<br /> }<br /> }<br /> <br /> function DisplayError($msg)<br /> {<br /> $errorTrackFile = dirname(__FILE__).'/../data/mysql_error_trace.inc';<br /> if( file_exists(dirname(__FILE__).'/../data/mysql_error_trace.php') )<br /> {<br /> @unlink(dirname(__FILE__).'/../data/mysql_error_trace.php');<br /> }<br /> $emsg = '';<br /> $emsg .= "<div><h3>Error Warning!</h3>\r\n";<br /> $emsg .= "<div style='line-helght:160%;font-size:14px;color:green'>\r\n";<br /> $emsg .= "<div style='color:blue'><br />Error page: <font color='red'>".$this->GetCurUrl()."</font></div>\r\n";<br /> $emsg .= "<div>Error infos: {$msg}</div>\r\n";<br /> $emsg .= "<br /></div></div>\r\n";<br /> <br /> echo $emsg;<br /> }<br /> ?>