first commit
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
// Carica .env
|
||||
require_once __DIR__ . '/../../vendor/autoload.php'; // adattare al percorso giusto
|
||||
|
||||
use Dotenv\Dotenv;
|
||||
|
||||
// carica variabili dalla root del progetto
|
||||
$dotenv = Dotenv::createImmutable(__DIR__ . '/../../');
|
||||
$dotenv->load();
|
||||
|
||||
// Prende i valori dal .env
|
||||
$hostname_bkngstm = $_ENV['DB_HOST'] ?? 'localhost';
|
||||
$database_bkngstm = $_ENV['DB_DATABASE'] ?? 'yogibookaury';
|
||||
$username_bkngstm = $_ENV['DB_USERNAME'] ?? 'root';
|
||||
$password_bkngstm = $_ENV['DB_PASSWORD'] ?? '';
|
||||
|
||||
$servername = $hostname_bkngstm;
|
||||
$username = $username_bkngstm;
|
||||
$password = $password_bkngstm;
|
||||
$dbname = $database_bkngstm;
|
||||
|
||||
@session_start();
|
||||
|
||||
// Connessione MySQLi
|
||||
$bkngstm = mysqli_init();
|
||||
if (defined("MYSQLI_OPT_INT_AND_FLOAT_NATIVE")) {
|
||||
$bkngstm->options(MYSQLI_OPT_INT_AND_FLOAT_NATIVE, true);
|
||||
}
|
||||
$bkngstm->real_connect(
|
||||
$hostname_bkngstm,
|
||||
$username_bkngstm,
|
||||
$password_bkngstm,
|
||||
$database_bkngstm
|
||||
) or die("Connect Error: " . mysqli_connect_error());
|
||||
Reference in New Issue
Block a user