PostgreSQL

pgsql is the name of the PHP extension that provides the interface to interact with the PostgreSQL database.

pgsql defines functions, constants and classes. It has been upgraded to use objects instead of resources.

<?php

    // example from the PHP manual : https://www.php.net/manual/en/pgsql.examples-basic.php

    // Connecting, selecting database
    $dbconn = pg_connect('host=localhost dbname=publishing user=www password=foo')
        or die('Could not connect: ' . pg_last_error());

    // Performing SQL query
    $query = 'SELECT * FROM authors';
    $result = pg_query($dbconn, $query) or die('Query failed: ' . pg_last_error());

?>

Documentation

See also PostgreSQL homepage, How to Connect PHP and PostgreSQL and How to build an Application with PHP and PostgreSQL.

Related : Database, Structured Query Language (SQL), JavaScript Object Notation (JSON), Relational DataBase Management System (RDBMS), SQL Database