当前位置: 代码迷 >> PHP >> sql中执行没有关问题php中执行出错~
  详细解决方案

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

热度:109   发布时间:2013-01-23 10:44:49.0
sql中执行没问题php中执行出错~~
错误是Access denied for user: 'ODBC@localhost' (Using password: NO)
我之前用的也是空密码,也没出错,现在其他文件也没出错,就这一个出错,贴出代码如下

<?php
error_reporting(0);
session_start();
require('../libs/Smarty.class.php');
$smarty = new Smarty;
//$smarty->force_compile = true;
$smarty->debugging = false;
$smarty->caching = false;
$smarty->cache_lifetime = 120;



if($_POST['ok'].value==1)
{
$username=$_POST['username'];
$userpwd=$_POST['userpwd'];
$query=mysql_query("INSERT INTO user (user,pwd)  values 

('$username','$userpwd')")or die(mysql_error());
if($query)
{
$response="<script>alert('注册成功');</script>
<meta  http-equiv=refresh content='0; url=login.php'>";
}
else
{
$response="<script>alert('注册失败');</script>";

}
}
$smarty->assign("regstatus",$response);
$smarty->display("reg.html");
?>

------解决方案--------------------
没人回答时,完全可以 管理菜单-》删除帖子。
------解决方案--------------------
所以说啊 自己找找原因先
  相关解决方案