Created
March 27, 2019 23:28
-
-
Save erick-jeronimo/63d8666863e13ff18230d35ed5ec39e3 to your computer and use it in GitHub Desktop.
This file contains 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 | |
date_default_timezone_set('America/Belem'); | |
$dbname = ''; | |
$user = ''; | |
$pass = ''; | |
try { | |
$conn = new PDO( 'mysql:host=' . 'localhost' . ';dbname=' . $dbname, $user, $pass, array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'utf8'")); | |
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); | |
} catch ( PDOException $e ) { | |
echo 'Erro ao conectar com o MySQL: ' . $e->getMessage(); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment