Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/file/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Server MAMP服务器错误500_Server_Mamp - Fatal编程技术网

Server MAMP服务器错误500

Server MAMP服务器错误500,server,mamp,Server,Mamp,在编写简单的mysql_connect时,我遇到了服务器错误 <?php $hostname = "localhost"; $username = "root"; $password = "roo1t"; $databaseName = "alphacrm"; $dbConnected = mysql_connect($hostname, $username, $password); ?> 我试图回显$dbConnected with if block的状态,但我认为

在编写简单的mysql_connect时,我遇到了服务器错误

<?php


$hostname = "localhost";
$username = "root";
$password = "roo1t";

$databaseName = "alphacrm";

$dbConnected = mysql_connect($hostname, $username, $password);

?>


我试图回显$dbConnected with if block的状态,但我认为,由于mysql\u connect,我收到了错误。

尝试更改此行:

$dbConnected = mysql_connect($hostname, $username, $password);
为此:

$dbConnected = mysqli_connect($hostname, $username, $password);

尝试更改此行:

$dbConnected = mysql_connect($hostname, $username, $password);
为此:

$dbConnected = mysqli_connect($hostname, $username, $password);

到目前为止你试过什么?例如,您是否能够使用MySQL的相关命令行实用程序,
MySQL(1)
连接到MySQL数据库?调用
mysql\u connect()
时,您收到的确切错误消息是什么?您确定您的用户名、密码和其他详细信息正确吗?问题已解决。我正在使用“mysql\u connect”,尝试使用“mysqli\u connect”并建立了连接。到目前为止,您尝试了什么?例如,您是否能够使用MySQL的相关命令行实用程序,
MySQL(1)
连接到MySQL数据库?调用
mysql\u connect()
时,您收到的确切错误消息是什么?您确定您的用户名、密码和其他详细信息正确吗?问题已解决。我正在使用“mysqli\u connect”,尝试使用“mysqli\u connect”并建立连接。