-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
47 lines (39 loc) · 906 Bytes
/
index.php
File metadata and controls
47 lines (39 loc) · 906 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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
/**
*################################
*#> Powered by Nerdtrix.org <#
*################################
*
* @copyright (c) Nerdtrix LLC 2021 - Current
* @author Name: Jerry Urena
* @author Social links: @jerryurenaa
* @author email: jerryurenaa@gmail.com
* @author website: jerryurenaa.com
* @license MIT (included within this project)
*
*/
/**
* This is an example connecting to mysql database
*/
try
{
$config = [
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_CASE => PDO::CASE_NATURAL,
PDO::ATTR_ORACLE_NULLS => PDO::NULL_EMPTY_STRING
];
$db = new PDO(sprintf(
"mysql:host=%s;dbname=%s",
"host.docker.internal",
"dockerexample"),
"user",
"password",
$config
);
#connection successful
print("DB connected");
}
catch(PDOException $e)
{
die(print_r($e->getMessage()));
}