Skip to content

Instantly share code, notes, and snippets.

@jasonmccallister
Created April 3, 2020 18:02
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jasonmccallister/a23ef00a96b32aaad0617728ca7fbe7c to your computer and use it in GitHub Desktop.
Save jasonmccallister/a23ef00a96b32aaad0617728ca7fbe7c to your computer and use it in GitHub Desktop.
<?php
try {
(new PDO(
'mysql:host=' . getenv('DB_SERVER'),
getenv('DB_USER'),
getenv('DB_PASSWORD')
))->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
echo 'success';
} catch (PDOException $e) {
error_log($e->getMessage());
echo 'error';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment