小弟,刚开学PHP,今天连接数据库时不知道出了什么问题,下面代码就是不能运行,在firefox显示页面载入出错,我的php.ini配置中把extension=php_mysql.dll前面的分号也去掉了,php_mysql.dll动态文件放在php的目录下面,使用改变环境变量path来加载php_mysql.dll,哪位大哥帮帮忙啊,急啊 !谢谢了!
<html>
<head>
<title> SSS </title>
</head>
<center>
<body>
<?php
$link=mysql_connect('localhost','root','123456798');
if(!$link) echo "数据库连接失败!<br>".mysql_error();
else echo "数据库连接成功!<br>";
mysql_close();
?>
</center>
</body>
</html>
<html>
<head>
<title> SSS </title>
</head>
<center>
<body>
<?php
$link=mysql_connect('localhost','root','123456798');
if(!$link) echo "数据库连接失败!<br>".mysql_error();
else echo "数据库连接成功!<br>";
mysql_close();
?>
</center>
</body>
</html>
應該是放在 PHP/ext裏吧
嘛 這取決於 extension_dir 的設置更重要的是沒看到你說把 libmysql.dll 放到system32 裏...
我是没有把libmysql.dll 放入到system32中,但是我在环境变量里面添加了;d:\php\ext和;d:\php,系统启用的时候可以从这两个文件夹中加载libmysql.dll这个模块吧?
觉得是你的密码错了。。'123456798' 是不是 123456789 ?