在PHP页面上获取“内部系统错误”
问题描述:
我使用简单的登录设置网站。我主要是在远程服务器上设置它,然后决定设置一个测试服务器。它运行良好,然后我将文件上传到远程服务器。现在我在所有的PHP页面上都出现“内部系统错误”。我是PHP新手,使用Dreamweaver。我没有在这里找到我的特殊情况。 DW中的错误指向下面的文件(特别是第9行)。我不知道如何解决它。谁能帮忙?在PHP页面上获取“内部系统错误”
<?php
# FileName="Connection_php_mysql.htm"
# Type="MYSQL"
# HTTP="true"
$hostname_thelivingoracles = "localhost";
$database_thelivingoracles = "thelivingoracles";
$username_thelivingoracles = "username";
$password_thelivingoracles = "password";
$thelivingoracles = mysqli_connect($hostname_thelivingoracles,
$username_thelivingoracles, $password_thelivingoracles) or
trigger_error(mysql_error(),E_USER_ERROR);
?
答
通常连接到特定数据库mysqli_connect时()语法是:
$link = mysqli_connect("127.0.0.1", "my_user", "my_password", "my_db");
看起来你已经离开了你的数据库的名字吗?
$thelivingoracles = mysqli_connect($hostname_thelivingoracles,
$username_thelivingoracles, $password_thelivingoracles, $database_thelivingoracles) or
trigger_error(mysql_error(),E_USER_ERROR);
此外,脚本末尾没有关闭'>'字符,我认为这是一个复制粘贴问题。
您只将3个参数传递到第9行的mysqli_connect而不是4.您缺少数据库参数。 http://php.net/manual/en/function.mysqli-connect.php – Matt