<?php
$DB_HOST = getenv('DB_HOST') ?: 'localhost';           // or mysql.yourhost.com
$DB_USER = getenv('DB_USER') ?: 'nexorahc_watching';                // your DB user on host
$DB_PASS = getenv('DB_PASS') ?: 'Nexorah.com.bd';                    // your DB password
$DB_NAME = getenv('DB_NAME') ?: 'nexorahc_watching';            // the DB name you created
$DB_PORT = getenv('DB_PORT') ?: 3306;

$mysqli = new mysqli($DB_HOST, $DB_USER, $DB_PASS, $DB_NAME, (int)$DB_PORT);
if ($mysqli->connect_error) {
    die('Database connection failed: ' . $mysqli->connect_error);
}
function db() {
    global $mysqli;
    return $mysqli;
}
?>