PostgreSQL PDO¶
PDO_PGSQL is a PHP-native driver that implements the PHP Data Objects (PDO) interface, which enables access from PHP to PostgreSQL databases.
Install
The module is mostly built into PHP itself.
Synopsis
<?php
$connection = new PDO("pgsql:host=localhost;port=5432;user=crate");
$cursor = $connection->query("SELECT * FROM sys.summits ORDER BY height DESC LIMIT 3");
print_r($cursor->fetchAll(PDO::FETCH_ASSOC));
?>
See also
Documentation
The full documentation for PDO_PGSQL.
Example
An executable example using the PDO_PGSQL driver.