Last active
January 3, 2016 11:49
-
-
Save MMcM/8458290 to your computer and use it in GitHub Desktop.
Check PHP PDO connectivity.
This file contains hidden or 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 | |
$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