Fatal error: Uncaught Error: Call to undefined function mysql_connect()

If this problem occurs, you can follow the following steps.
1. First of all, you should make sure that you are using the version of PHP. If it’s version 7.x, you should use mysqli_connect(), since mysqli_connect() has been dropped in version 7.x, or you can use PDO instead. The 5.x version of mysql_connect() and mysqli_connect() are both available.
2. If you don’t succeed in the first step, you can do the following:
Mysql> create extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL with extension=php_mysqli. DLL; ‘removed. Php_mysqli. DLL =php_mysqli. DLL = ‘; ‘and you find that there is no extension=php_mysql. DLL because it has been deprecated.)
(2) Then look for extension_dir = “ext”. ‘Remove it. 5.x is the same as 7.x.
(3) Then restart Apache.

Read More: