I am trying to establish a simple connection with mysqli_connect, here is the code (using XAMPP)
$CLASS_CONFIG["table_prefix"] = "TEST";
$CLASS_CONFIG["db_hostname"] = "localhost";
$CLASS_CONFIG["db_user"] = "root";
$CLASS_CONFIG["db_password"] = "";
$CLASS_CONFIG["db_name"] = "test";
$CLASS_CONFIG["debug"] = true;
$CLASS_CONFIG["conn"] = mysqli_connect($CLASS_CONFIG["db_hostname"], $CLASS_CONFIG["db_user"],
$CLASS_CONFIG["db_password"], $CLASS_CONFIG["db_name"]);
However, the mysqli_connect keeps returning NULL. I have tried so many things and scoured the internet and have come up with absolutely no solution!
Thanks for any help
EDIT: This is not a duplicate as no other questions have managed to solve my issue. I am using Laravel and the exact error is:
mysqli_query() expects parameter 1 to be mysqli, null given (View: /opt/lampp/htdocs/lazzaricosmetics/resources/views/admin/admin_prodotti.blade.php)
The query is:
$result = mysqli_query($CLASS_CONFIG["conn"], $sql) or die (mysqli_error($CLASS_CONFIG["conn"]) . " " . $sql);