You have upgraded to PHP 7, and now the mysql_connect is deprecated. Check it now 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.
I hope this helps !
If you want to learn more about SQL, Check out this SQL Certification by Intellipaat.