Problem scenario
You are trying to establish a connection with a username and password to a Postgres database using PHP. You have a PHP file like this:
<?php
$host = “host=127.0.0.1”;
$port = “port=5432”;
$dbname = “dbname=contint”;
$credentials = “user=contint password=excellent”;
$db = pg_connect( “$host $port $dbname $credentials” );
if(!$db){
echo “Error : Unable to open database\n”;
…