Skip to content

Instantly share code, notes, and snippets.

@MMcM
Last active January 3, 2016 11:49
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 MMcM/8458290 to your computer and use it in GitHub Desktop.
Save MMcM/8458290 to your computer and use it in GitHub Desktop.
Check PHP PDO connectivity.
<?php
$dbh = new PDO("pgsql:host=localhost port=15432 dbname=system");
$stmt = $dbh->prepare('SELECT version()');
$stmt->execute();
$row = $stmt->fetch();
echo $row[0] . "\n";
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment