Skip to content

Instantly share code, notes, and snippets.

@lablnet
Created July 13, 2017 08:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lablnet/ad14af74b54e7865c1deb7408609df3c to your computer and use it in GitHub Desktop.
Save lablnet/ad14af74b54e7865c1deb7408609df3c to your computer and use it in GitHub Desktop.
PHP pdo
<?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