PHP cant connect to MySQL

前端 未结 5 2004
我寻月下人不归
我寻月下人不归 2021-01-24 21:42
$link = mysql_connect(\'localhost\', $username, $password);
if (!$link) 
{
     die(\'Could not connect: \' . mysql_error());
}

I get this error:

5条回答
  •  悲&欢浪女
    2021-01-24 22:17

    Did you give $username and $password values? Something like this?

    $username="root";
    $password="";
    

提交回复
热议问题