PHP Function Pg_Host
PHP has over 1000 built-in functions that can be used to accomplish a wide range of tasks. These functions can be called directly from within a script, and they will execute on behalf of the script.
In this article we will be discussing the php function pg_host, which can be used to return the host name of a given PostgreSQL database instance. This function is especially useful when you need to know the name of a specific database server that you are connecting to.
This function is primarily used when creating persistent database connections. Persistent database connections are held open beyond the lifetime of a page request, and can be reused by subsequent requests. This function can help to avoid the overhead of creating a new database connection each time that a persistent connection is needed.
The name of a specific PostgreSQL prepared statement to create. Must be unique per-connection; if "" is specified, any existing unnamed prepared statements will be replaced. A query string to parameterise the prepared statement. If any parameters are used, they will be referred to as $1, $2, etc.
If the current SELinux context of phpPgAdmin is set to the incorrect value, then you will get error messages like “string indices must be integers” and “column rel.relhasoids does not exist”. To resolve this, you must either change the SELinux context of phpPgAdmin to the correct value, or remove this particular server from the list in pgAdmin and add a fresh one.