Files
portal_v3/portal/admin/services/v3/database.php
equippedcoding-master 1c59875b8a initial commit 2
2025-09-17 15:19:57 -05:00

25 lines
700 B
PHP

<?php
require_once dirname( __DIR__ ) . "/admin/core/api/php/includes/include.php";
// /home/cradle2careertxxyz/websites/www10/portal/admin/core/api/php/init.php
$host = $GLOBALS['config']['mysql']['host'];
$dbname = $GLOBALS['config']['mysql']['db'];
$username = $GLOBALS['config']['mysql']['username'];
$password = $GLOBALS['config']['mysql']['password'];
// var_dump($GLOBALS['config']['mysql']);
$mysqli = new mysqli(hostname: $host,
username: $username,
password: $password,
database: $dbname);
if ($mysqli->connect_errno) {
die("Connection error: " . $mysqli->connect_error);
}
return $mysqli;