php网站首页报错 Resource id #6

WBOY
Release: 2016-06-23 14:38:08
Original
1236 people have browsed it

测试页面报错:
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

<?phpfunction 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()." <br />Error sql: <font color='red'>".$this->queryString."</font>");	}}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 .= "<div><h3>Error Warning!</h3>\r\n";	$emsg .= "<div style='line-helght:160%;font-size:14px;color:green'>\r\n";	$emsg .= "<div style='color:blue'><br />Error page: <font color='red'>".$this->GetCurUrl()."</font></div>\r\n";	$emsg .= "<div>Error infos: {$msg}</div>\r\n";	$emsg .= "<br /></div></div>\r\n";	echo $emsg;}?>
Copy after login


回复讨论(解决方案)

 No database selected 
检查下……

Error infos: No database selected 没选择数据库。

配置有问题吧!

 No database selected 
检查下……

尴尬...重新检查了下,发现是数据库名写错了...上横杆、下横杠搞错了
谢谢你

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template