mirror of
https://github.com/neosubhamoy/neosubhamoy-portfolio.git
synced 2025-12-20 02:19:34 +05:30
(refactor): changed connection.php credentials into .env
This commit is contained in:
15
htdocs/core/connection.php
Normal file
15
htdocs/core/connection.php
Normal file
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
//Collect Database info
|
||||
$hostname = $_ENV['DB_HOST'];
|
||||
$username = $_ENV['DB_USER'];
|
||||
$password = $_ENV['DB_PASS'];
|
||||
$database = $_ENV['DB_NAME'];
|
||||
|
||||
//Connect with Database
|
||||
$conn = new mysqli($hostname, $username, $password, $database);
|
||||
|
||||
if ($conn -> connect_error) {
|
||||
die("Database Connection Failed !" . $conn->connect_error);
|
||||
}
|
||||
echo "";
|
||||
?>
|
||||
Reference in New Issue
Block a user