Skip to content

Instantly share code, notes, and snippets.

@redgluten
Created August 16, 2016 08:10
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 redgluten/227c60800cfa74e6e95d4c4da5571a64 to your computer and use it in GitHub Desktop.
Save redgluten/227c60800cfa74e6e95d4c4da5571a64 to your computer and use it in GitHub Desktop.
Basic PDO based connection class for PHP
<?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