I kept on receiving this error
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 80
Deprecated: Assigning the return value of new by reference is deprecated in C:\xampp\php\PEAR\Config.php on line 166
Fatal error: Class 'mysqli_connect' not found in C:\xampp\htdocs\bb2\includes\classes\connection.php on line 3
I have no idea why, here’s my code
this is config.php
<?php
define("DB_HOST","localhost");
define("DB_USER","root");
define("DB_NAME","beatbeast");
define("DB_PASSWORD","123192");
?>
and this is my connection.php
<?php
require_once('config.php');
$mysqli = new mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
You shouldn’t be using
newwithmysqli_connect– the procedural versions of themysqli_calls don’t use object syntax.If you want to use
new, usenew mysqli().As for the deprecation warnings, see this question.