pg_dbname

(PHP 3, PHP 4, PHP 5)

pg_dbname -- 獲得資料庫名

說明

string pg_dbname ( resource connection )

pg_dbname() 返回給定 PostgreSQL connection 資源的資料庫名稱。若果 connection 不是有效的 PostgreSQL 連線資源則返回 FALSE

例子 1. pg_dbname() 例子

<?php
    error_reporting
(E_ALL);

    
pg_connect("host=localhost port=5432 dbname=mary");
    echo 
pg_dbname(); // mary
?>