Last active
March 21, 2020 02:07
-
-
Save alexalannunes/af87e0d22af5d89e115b62322ded316f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
define('DRIVER', 'pgsql'); | |
define('HOST', 'localhost'); | |
define('USER', 'postgres'); | |
define('PASS', 'a0l11e4x23'); | |
define('DATABASE', 'alexalannunes'); | |
define('OPTIONS', array( | |
PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES utf8", | |
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, | |
PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, | |
PDO::ATTR_CASE => PDO::CASE_NATURAL, | |
// force int column return as int (default: column return as string) | |
PDO::ATTR_STRINGIFY_FETCHES => false, | |
PDO::ATTR_EMULATE_PREPARES => false | |
)); | |
// | |
define('DNS', DRIVER . ':host=' . HOST . ';dbname=' . DATABASE); | |
$pdo = new PDO(DNS, USER, PASS, OPTIONS); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment