ProxySQL Error when changing from mysql to mysqli

Hi all,

Looking to remove all depreciated mysql from my website.
Using the same settings, I am able to connect successfully when using my old mysql_connect:

$this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS) or die(mysql_error());
mysql_select_db(DB_NAME, $this->connection) or die(mysql_error());

This works

However, I’m trying to change it to mysqli, using the following:
$this->connection = new mysqli(“localhost”, DB_USER, DB_PASS, DB_NAME);
if ($mysqli->connect_errno) {
echo “Failed to connect to MySQL: (” . $mysqli->connect_errno . ") " . $mysqli->connect_error;
}
This doesn’t work.

Error I get on the site:
ProxySQL Error: Access denied for user ‘1512256’@‘2a02:4780:bad:f00d::4’ (using password: NO)

Revert to older PHP version using GENERAL SETTINGS on 000webhost.com and your site should function as before.

You need a hostname, localhost, username, database name and password to correctly connected to a database on 000webhost.com all under MANAGE DATABASE on 000webhost.com

Check out tutorials section for connecting to MYSQL with PHP