Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #
- <?php
- #
- #
- $DB_DSN="pgsql:dbname=cluebringer;host=server1.hostname.com";
- #
- $DB_USER="ore";
- #
- $DB_PASS="password";
- #
- #
- ?>
- #
- #
- #
- #
- #
- #
- cat db.php
- #
- <?php
- #
- #
- require_once('includes/config.php');
- #
- #
- #
- function connect_db()
- #
- {
- #
- global $DB_DSN;
- #
- global $DB_USER;
- #
- global $DB_PASS;
- #
- #
- try {
- #
- $dbh = new PDO($DB_DSN, $DB_USER, $DB_PASS, array(
- #
- PDO::ATTR_PERSISTENT => false
- #
- ));
- #
- #
- $dbh->setAttribute(PDO::ATTR_CASE,PDO::CASE_LOWER);
- #
- #
- } catch (PDOException $e) {
- #
- die("Error connecting to Policyd v2 DB: " . $e->getMessage());
- #
- }
- #
- #
- return $dbh;
- #
- }
- #
- #
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement