-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.php
48 lines (37 loc) · 1.14 KB
/
config.php
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<?php
/*
|--------------------------------------------------------------------------
| Database Connections Config
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup.
|
*/
$connections = [
'driver' => 'mysql',
'host' => 'localhost',
'port' => '3306',
'database' => 'cv_db',
'username' => 'root',
'password' => 'root',
];
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
try {
$connection = new PDO(
"{$connections['driver']}:host={$connections['host']};dbname={$connections['database']}",
$connections['username'],
$connections['password']
);
$connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
echo $e->getMessage();
}