Knowledgebase: Linux Hosting Cpanel/WHM
Call to undefined function mysql_connect
Posted by Premium Reseller on 21 June 2019 02:59 AM
|
|
mysql_connect extension was deprecated in PHP 5.5.0, and it was removed in PHP 7.0.0. MySQLi or PDO_MySQL extension should be used to connect mysql database from php script. mysqli_connect() PDO::__construct() https://www.php.net/manual/en/book.mysqli.php https://www.php.net/manual/en/ref.pdo-mysql.php Sample connection string with mysqli: $con = mysqli_connect('localhost', 'username', 'password', 'database'); Sample connection string with pdo-mysql: $user = ''; // Mysql User | |
|