forked from Leacocks/Landing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdb.inc.example.php
More file actions
30 lines (26 loc) · 786 Bytes
/
Copy pathdb.inc.example.php
File metadata and controls
30 lines (26 loc) · 786 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
28
29
30
<?php
class DB {
private static $dbs = array(
'features' => array(
'host' => '',
'user' => '',
'password' => '',
'db' => ''
),
'other' => array(
'host' => '',
'user' => '',
'password' => '',
'db' => ''
)
);
public static function establish_database_connection($section='features'){
$mysqli = new mysqli(DB::$dbs[$section]['host'], DB::$dbs[$section]['user'], DB::$dbs[$section]['password'], DB::$dbs[$section]['db']);
if ($mysqli->connect_errno) {
echo "Failed to connect to MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error;
return FALSE;
}
return $mysqli;
}
}
?>