-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathdatabase.php
More file actions
27 lines (22 loc) · 674 Bytes
/
database.php
File metadata and controls
27 lines (22 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php
// Declare ini File
$ini = parse_ini_file('sql/config.ini');
// Create ini Array
$db_info = array(
"db_host" => $ini['db_host'],
"db_user" => $ini['db_user'],
"db_pass" => $ini['db_pass'],
"db_name" => $ini['db_name'],
"db_host_ip" => $ini['db_host_ip']
);
// Declare ini Variables
$host = $db_info['db_host'];
$username = $db_info['db_user'];
$password = $db_info['db_pass'];
$database = $db_info['db_name'];
$hostIP = $db_info['db_host_ip'];
//Setup Connection
$conn = mysqli_connect($host, $username, $password, $database);
if (!$conn) {
die('Unable to Connect to the Database!' . mysqli_connect_error());
}