Created
July 13, 2017 08:41
-
-
Save lablnet/ad14af74b54e7865c1deb7408609df3c to your computer and use it in GitHub Desktop.
PHP pdo
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 | |
try{ | |
$db = new PDO("mysql:host=localhost;dbname=lablnet_cms", "root" ,""); | |
$db->setAttribute(PDO::ATTR_ERRMODE,PDO::ERRMODE_EXCEPTION); | |
$db->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_ASSOC); | |
}catch(Exception $e){ | |
die($e->getMessage()); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment