【发布时间】:2012-10-11 06:14:37
【问题描述】:
我在 xampp 的 phpmyadmin 中创建了我的数据库“MUSIC”。我正在尝试使用我存储在 OML 文件夹中的 php 文件连接到该数据库,该文件又存在于 htdocs 文件夹中,我的代码是:
$db_name="MUSIC";
$db_user="root";
$db_pwd="ash123";
$db_host="localhost";
$connect = mysql_connect("localhost","root","ash123");
mysql_select_db("MUSIC");
echo "connection successful";
但是当我转到 localhost 并输入 localhost/connect.php 时,我收到此错误:
Object not found!
the requested URL was not found on this server.if u entered the URL manually please check your spelling and try again.If you think this is a server error,please contact webmaster.
Error 404
localhost
Apache/2.4.3 (Unix) OpenSSL/1.0.1c PHP/5.4.7
我已经搜索过,但我找到了解决这个问题的方法,请帮助!
【问题讨论】:
-
文件是否存在?您确定将文档根目录设置为正确的目录吗?
-
默认 XAMPP 使用 8080 端口,php 文件应该在 /htdocs 文件夹中。试试localhost:8080/connect.php
-
错误是否实际上是说“......如果你手动输入网址......”;)
标签: php mysql database phpmyadmin