You upgraded to PHP 7, and now mysql_connect
is deprecated. Check yours with:
php -version
Change it to mysqli_connect
as in:
$host = "127.0.0.1";
$username = "root";
$pass = "foobar";
$con = mysqli_connect($host, $username, $pass, "your_database");
If you're upgrading legacy PHP, now you're faced with the task of upgrading all your mysql_*
functions with mysqli_*
functions.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…