Created
August 16, 2016 08:10
-
-
Save redgluten/227c60800cfa74e6e95d4c4da5571a64 to your computer and use it in GitHub Desktop.
Basic PDO based connection class for PHP
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 | |
class Connection | |
{ | |
public function make($dsl, $username, $password) | |
{ | |
try { | |
return new PDO($dsl, $username, $password); | |
} catch (PDOException $e) { | |
die($e->getMessage()); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment