warning with error ......"head ach"

ggto 2002-10-24 06:28:46
Warning: Access denied for user: 'Hunterboy@localhost' (Using password: YES) in E:\Inetput\wwwroot\php-test\test-php\MySql.php on line 3

Warning: MySQL Connection Failed: Access denied for user: 'Hunterboy@localhost' (Using password: YES) in E:\Inetput\wwwroot\php-test\test-php\MySql.php on line 3
could not connecton to db
...全文
34 29 打赏 收藏 转发到动态 举报
写回复
用AI写文章
29 条回复
切换为时间正序
请发表友善的回复…
发表回复
ggto 2002-10-25
  • 打赏
  • 举报
回复
謝謝 個位的幫助 結帖
ggto 2002-10-25
  • 打赏
  • 举报
回复
我在 www.php.net 都下載了 多次了,是不是 新版的都有這個問題哪,
我要是在下載的話 最好下載 哪個 版本的
謝謝 '赤腳'
goodname 2002-10-25
  • 打赏
  • 举报
回复
同意楼上的。
phpteam 2002-10-25
  • 打赏
  • 举报
回复
重新下个PHP吧!很常见!
ggto 2002-10-25
  • 打赏
  • 举报
回复
其他的都可以,就是變量搞不定呀!我的機器,服務器 都重起 N(N>N)次了
anziqi 2002-10-25
  • 打赏
  • 举报
回复
呵呵。如果我让你设的。
改一下这个php.ini
register_globals = on
你设了并好使的化就不必要我上面的那些变法了。
就象以前那么用不过安全性不太好。

如果你是iis按理说不必去重新启动我的就不必。

如果是apache那就得重启一下了。

request是你在get或post数据时接收用。

你以前的版本不是很高不必用。所以有现在的毛病。

要不你就重启一下机器看看你以前的好不好使。
goodname 2002-10-25
  • 打赏
  • 举报
回复
哦,楼上的楼上盗版
我要保护我的知识版权。嘿嘿。
anziqi 2002-10-25
  • 打赏
  • 举报
回复
就是变量的事了。

我这里可以通过了。你看看这个行不行。

你把要提交的变量都用request就可以了。
phpteam 2002-10-25
  • 打赏
  • 举报
回复
哈哈,这不是程序的问题!!!!!
重新启动机器,ok?
anziqi 2002-10-25
  • 打赏
  • 举报
回复
你试一下看看行不行。

<?php
function mysql_connection(){
$db_connect=mysql_connect("localhost","HunterBoy","ggwyboy") or die("could not connecton to db");
mysql_select_db("Hunter_test",$db_connect) or die("could not find db");
$pets_query="select * from test1";
$query_result=mysql_query($pets_query,$db_connect);
print"<center>\n";
print"<table border=1 width=60%>\n";
print"<tr><td align=center colspan=3>";
print"<strong>This is test of MySql!</strong>";
print"</td></tr>";
print"<tr>";
print"<td align=center width=10% bgcolor=gray>編號</td>";
print"<td align=center width=20% bgcolor=gray>姓名</td>";
print"<td align=center width=70% bgcolor=gray>描述</td>";
print"</tr>";
while($row=mysql_fetch_object($query_result))
{
print"\t<tr>\n";
print"\t\t<td>".$row->id."</td>\n";
print"\t\t<td>".$row->name."</td>\n";
print"\t\t<td>".$row->text."</td>\n";
print"\t</tr>\n";
}
print"</table>\n";
print"</center>";
mysql_close($db_connect);
}

function mysql_insert($name,$desc){
$db_insert=mysql_connect("localhost","HunterBoy","ggwyboy") or die("could not connecton to db");
mysql_select_db("Hunter_test",$db_insert) or die("could not find db");
$name=str_replace("<","<",$name);
$name=str_replace("\"",""",$name);
$name=stripslashes($name);

$desc=str_replace("<","<",$desc);
$desc=str_replace("\"",""",$desc);
$desc=stripslashes($desc);




$rst_query="insert into test1 values('','".$_REQUEST['txt_name']."','".$_REQUEST['txt_desc']."')";
$rst_result=mysql_query($rst_query);
$txt_name="";
$txt_desc="";

}
?>
<html>
<head><title>MySql Database TEST!</title>
<?php
$color1="black";
$color2="black";
print $_REQUEST['txt_name'];
print $_REQUEST['txt_desc'];
if(!empty($_REQUEST['aaa']))
{
print "aaaa1";
if($_REQUEST['txt_name']&&$_REQUEST['txt_desc']){
mysql_insert($txt_name,$txt_desc);
$txt_name="";
$txt_desc="";
mysql_connection();
}
else{
if(empty($_REQUEST['txt_name']))
$color1="red";
if(empty($_REQUEST['txt_desc']))
$color2="red";
mysql_connection();
}
}
else
mysql_connection();
?>
</head>
<body bgcolor=silver>
<form action="test.php" method=get>
<font size=4 color=<?print($color1)?>>Please input Name:</font><br />
<input type=text name=txt_name size=15 maxlength=15 value=<?print($txt_name)?>><br />
<font size=4 color=<?print($color2)?>>Please input you describe:</font><br />
<textarea name=txt_desc cols=20 rows=5><?print($txt_desc)?></textarea><br />
<input type=submit name=aaa value="提交!">
</form>
</body>
</html>

goodname 2002-10-25
  • 打赏
  • 举报
回复
哈哈
重新启动机器,ok?
phpteam 2002-10-25
  • 打赏
  • 举报
回复
重新启动服务!
ggto 2002-10-25
  • 打赏
  • 举报
回复
以前的忘了(不是我裝的) 現在的是 4.2.3
anziqi 2002-10-25
  • 打赏
  • 举报
回复
你以前是什么版本的。现在是什么版本的。

ggto 2002-10-25
  • 打赏
  • 举报
回复
那两个你定义的函数你测试可以通过吗?

//在以前的系統中可以,昨天我重裝系統了,php也重裝了,就成這樣了


<?php
print $_REQUEST['aaa'];

?>
<FORM METHOD=POST ACTION="<?ECHO $_SERVER['PHP_SELF']?>">
<INPUT TYPE="text" NAME="aaa" value=test>
<INPUT TYPE="submit">
</FORM>


個在我這裡可以
phpteam 2002-10-25
  • 打赏
  • 举报
回复
重新启动服务!
anziqi 2002-10-25
  • 打赏
  • 举报
回复
那两个你定义的函数你测试可以通过吗?

这个在你那里好使吗?
<?php
print $_REQUEST['aaa'];

?>
<FORM METHOD=POST ACTION="<?ECHO $_SERVER['PHP_SELF']?>">
<INPUT TYPE="text" NAME="aaa" value=test>
<INPUT TYPE="submit">
</FORM>
goodname 2002-10-25
  • 打赏
  • 举报
回复
重启动服务。
ggto 2002-10-25
  • 打赏
  • 举报
回复
<?php
function mysql_connection(){
$db_connect=mysql_connect("localhost","HunterBoy","ggwyboy") or die("could not connecton to db");
mysql_select_db("Hunter_test",$db_connect) or die("could not find db");
$pets_query="select * from test1";
$query_result=mysql_query($pets_query,$db_connect);
print"<center>\n";
print"<table border=1 width=60%>\n";
print"<tr><td align=center colspan=3>";
print"<strong>This is test of MySql!</strong>";
print"</td></tr>";
print"<tr>";
print"<td align=center width=10% bgcolor=gray>編號</td>";
print"<td align=center width=20% bgcolor=gray>姓名</td>";
print"<td align=center width=70% bgcolor=gray>描述</td>";
print"</tr>";
while($row=mysql_fetch_object($query_result))
{
print"\t<tr>\n";
print"\t\t<td>".$row->id."</td>\n";
print"\t\t<td>".$row->name."</td>\n";
print"\t\t<td>".$row->text."</td>\n";
print"\t</tr>\n";
}
print"</table>\n";
print"</center>";
mysql_close($db_connect);
}

function mysql_insert($name,$desc){
$db_insert=mysql_connect("localhost","HunterBoy","ggwyboy") or die("could not connecton to db");
mysql_select_db("Hunter_test",$db_insert) or die("could not find db");
$name=str_replace("<","<",$name);
$name=str_replace("\"",""",$name);
$name=stripslashes($name);

$desc=str_replace("<","<",$desc);
$desc=str_replace("\"",""",$desc);
$desc=stripslashes($desc);

$rst_query="insert into test1 values('','$name','$desc')";
$rst_result=mysql_query($rst_query,$db_insert);
$txt_name="";
$txt_desc="";
mysql_close($db_insert);
}
?>
<html>
<head><title>MySql Database TEST!</title>
<?php
$color1="black";
$color2="black";
echo $txt_name;

if(!empty($aaa))
{
if($txt_name&&$txt_desc){
mysql_insert($txt_name,$txt_desc);
$txt_name="";
$txt_desc="";
mysql_connection();
}
else{
if(empty($txt_name))
$color1="red";
if(empty($txt_desc))
$color2="red";
mysql_connection();
}
}
else
mysql_connection();
?>
</head>
<body bgcolor=silver>
<form action="mysql.php" method=get>
<font size=4 color=<?print($color1)?>>Please input Name:</font><br />
<input type=text name=txt_name size=15 maxlength=15 value=<?print($txt_name)?>><br />
<font size=4 color=<?print($color2)?>>Please input you describe:</font><br />
<textarea name=txt_desc cols=20 rows=5><?print($txt_desc)?></textarea><br />
<input type=submit name=aaa value="提交!">
</form>
</body>
</html>
anziqi 2002-10-25
  • 打赏
  • 举报
回复
你把代码给一下好吗?
加载更多回复(9)

21,881

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧