main
Last change
on this file was 75f74d9, checked in by Vlado 222039 <vlado.popovski@…>, 6 weeks ago |
Initial commit: Adding Book Tracker code
|
-
Property mode
set to
100644
|
File size:
413 bytes
|
Line | |
---|
1 | <?php
|
---|
2 | try {
|
---|
3 |
|
---|
4 | $host = 'localhost';
|
---|
5 | $port = '5432';
|
---|
6 | $dbname = 'BookTracker';
|
---|
7 | $username = 'postgres';
|
---|
8 | $password = '1';
|
---|
9 |
|
---|
10 | $conn = new PDO("pgsql:host=$host;port=$port;dbname=$dbname", $username, $password);
|
---|
11 |
|
---|
12 | $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
|
---|
13 |
|
---|
14 |
|
---|
15 | } catch (PDOException $e) {
|
---|
16 |
|
---|
17 | echo "Connection failed: " . $e->getMessage();
|
---|
18 | exit();
|
---|
19 | }
|
---|
20 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.