Home  >  Article  >  Backend Development  >  sql中执行没有关问题php中执行出错~

sql中执行没有关问题php中执行出错~

WBOY
WBOYOriginal
2016-06-13 12:56:06640browse

sql中执行没问题php中执行出错~~
错误是Access denied for user: 'ODBC@localhost' (Using password: NO)
我之前用的也是空密码,也没出错,现在其他文件也没出错,就这一个出错,贴出代码如下

<br />
<?php<br />
error_reporting(0);<br />
session_start();<br />
require('../libs/Smarty.class.php');<br />
$smarty = new Smarty;<br />
//$smarty->force_compile = true;<br />
$smarty->debugging = false;<br />
$smarty->caching = false;<br />
$smarty->cache_lifetime = 120;<br />
<br />
<br />
<br />
if($_POST['ok'].value==1)<br />
{<br />
	$username=$_POST['username'];<br />
	$userpwd=$_POST['userpwd'];<br />
	$query=mysql_query("INSERT INTO user (user,pwd)  values <br />
<br />
('$username','$userpwd')")or die(mysql_error());<br />
	if($query)<br />
	{<br />
		$response="<script>alert('注册成功');</script><br />
			<meta  http-equiv=refresh content='0; url=login.php'>";<br />
		}<br />
	else<br />
	{<br />
		$response="<script>alert('注册失败');</script>";<br />
			<br />
		}<br />
	}<br />
$smarty->assign("regstatus",$response);<br />
$smarty->display("reg.html");<br />
?><br />


------解决方案--------------------
没人回答时,完全可以 管理菜单-》删除帖子。
------解决方案--------------------
所以说啊 自己找找原因先
Statement:
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