Apparently this function does not return the database name given in the connection string. I tried this on apache 2.x/php4.3.x/pg7.4.x and apache 1.3.x/php5.x/pg8rc1 and saw this behavior on both setups.(PHP 4, PHP 5, PHP 7, PHP 8)
pg_options — Ottiene le opzioni associate alla connessione
pg_options() restituisce una stringa contenente
le opzioni specificate sull'istanza di connessione PostgreSQL
connection fornita.
connectionUn'istanza di PgSql\Connection.
Quando connection è null, viene usata la connessione predefinita.
La connessione predefinita è l'ultima connessione effettuata da pg_connect()
o pg_pconnect().
A partire da PHP 8.1.0, l'uso della connessione predefinita è deprecato.
Una string contenente le opzioni di
connection.
| Versione | Descrizione |
|---|---|
| 8.1.0 |
Il parametro connection ora si aspetta un'istanza di PgSql\Connection;
in precedenza, era attesa una resource.
|
| 8.0.0 |
connection ora è nullable.
|
Example #1 Esempio di pg_options()
<?php
$pgsql_conn = pg_connect("dbname=mark host=localhost");
echo pg_options($pgsql_conn);
?>Apparently this function does not return the database name given in the connection string. I tried this on apache 2.x/php4.3.x/pg7.4.x and apache 1.3.x/php5.x/pg8rc1 and saw this behavior on both setups.