Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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
You can’t perform that action at this time.