From 2c48aaf9a9dd8dd03c44af074feac57f2318bff9 Mon Sep 17 00:00:00 2001 From: Christopher Kings-Lynne Date: Tue, 5 Apr 2005 05:55:14 +0000 Subject: [PATCH] - Convert more pgsql docs to new docs style. Add undocumented constant. Update reference. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@183634 c90b9560-bf6c-de11-be94-00142212c4b1 --- reference/pgsql/constants.xml | 14 +++- .../pgsql/functions/pg-affected-rows.xml | 75 ++++++++++++----- .../pgsql/functions/pg-client-encoding.xml | 70 +++++++++++++--- reference/pgsql/functions/pg-close.xml | 53 ++++++++++-- reference/pgsql/functions/pg-connect.xml | 80 +++++++++++++------ reference/pgsql/functions/pg-num-fields.xml | 60 ++++++++++++-- reference/pgsql/functions/pg-num-rows.xml | 66 ++++++++++++--- reference/pgsql/reference.xml | 4 +- 8 files changed, 341 insertions(+), 81 deletions(-) diff --git a/reference/pgsql/constants.xml b/reference/pgsql/constants.xml index 1f19807b9e..e36bf972f0 100644 --- a/reference/pgsql/constants.xml +++ b/reference/pgsql/constants.xml @@ -1,5 +1,5 @@ - +
&reftitle.constants; &extension.constants; @@ -41,6 +41,18 @@ + + + PGSQL_CONNECT_FORCE_NEW + (integer) + + + + Passed to pg_connect to force the creation of a new connection, + rather then re-using an existing identical connection. + + + PGSQL_CONNECTION_BAD diff --git a/reference/pgsql/functions/pg-affected-rows.xml b/reference/pgsql/functions/pg-affected-rows.xml index 3171807ceb..05999dc63a 100644 --- a/reference/pgsql/functions/pg-affected-rows.xml +++ b/reference/pgsql/functions/pg-affected-rows.xml @@ -1,5 +1,5 @@ - + @@ -15,23 +15,9 @@ pg_affected_rows returns the number of tuples - (instances/records/rows) affected by INSERT, UPDATE, and DELETE - queries executed by pg_query. If no tuple is - affected by this function, it will return 0. - - - - <function>pg_affected_rows</function> example - - -]]> - - + (instances/records/rows) affected by INSERT, + UPDATE, and DELETE + queries. @@ -40,11 +26,64 @@ + + &reftitle.parameters; + + + + result + + + PostgreSQL query result resource, returned by pg_query, + pg_query_params or pg_execute + (among others). + + + + + + + + + &reftitle.returnvalues; + + The number of rows affected by the query. If no tuple is + affected, it will return 0. + + + + &reftitle.examples; + + + <function>pg_affected_rows</function> example + + +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; pg_query + pg_query_params + pg_execute pg_num_rows diff --git a/reference/pgsql/functions/pg-client-encoding.xml b/reference/pgsql/functions/pg-client-encoding.xml index e5439f75ba..bf307075fa 100644 --- a/reference/pgsql/functions/pg-client-encoding.xml +++ b/reference/pgsql/functions/pg-client-encoding.xml @@ -1,5 +1,5 @@ - + @@ -16,20 +16,19 @@ resourceconnection + PostgreSQL supports automatic character set conversion between + server and client for certain character sets. pg_client_encoding returns the client - encoding as the string. The returned string should be either : - SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW, UNICODE, - MULE_INTERNAL, LATINX (X=1...9), KOI8, WIN, ALT, SJIS, BIG5, - WIN1250. + encoding as a string. The returned string will be one of the + standard PostgreSQL encoding identifiers. - This function requires PHP-4.0.3 or higher and PostgreSQL-7.0 or + This function requires PHP 4.0.3 or higher and PostgreSQL 7.0 or higher. If libpq is compiled without multibyte encoding support, - pg_set_client_encoding always return - "SQL_ASCII". Supported encoding depends on PostgreSQL - version. Refer to PostgreSQL manual for details to enable - multibyte support and encoding supported. + pg_set_client_encoding always returns + SQL_ASCII. Supported encoding depends on PostgreSQL + version. Refer to the PostgreSQL Documentation supported encodings. The function used to be called pg_clientencoding. @@ -37,6 +36,57 @@ + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + The client encoding, or &false; on error. + + + + + &reftitle.examples; + + + <function>pg_client_encoding</function> example + + +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-close.xml b/reference/pgsql/functions/pg-close.xml index 0cc27644bf..a25a410560 100644 --- a/reference/pgsql/functions/pg-close.xml +++ b/reference/pgsql/functions/pg-close.xml @@ -1,5 +1,5 @@ - + @@ -16,7 +16,7 @@ pg_close closes the non-persistent connection to a PostgreSQL database associated with the given - connection resource. &return.success; + connection resource. @@ -31,6 +31,32 @@ + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. When + connection is not present, the default connection + is used. The default connection is the last connection made by + pg_connect or pg_pconnect. + + + + + + + + + &reftitle.returnvalues; + + &true; on success, &false; on failure. + + + &reftitle.examples; @@ -39,16 +65,31 @@ ]]> + &example.outputs; + + + + + + &reftitle.seealso; + + + pg_connect + + + + @@ -14,38 +14,17 @@ stringconnection_string intconnect_type - - pg_connect returns a connection resource - that is needed by other PostgreSQL functions. - pg_connect opens a connection to a PostgreSQL database specified by the - connection_string. It returns a connection - resource on success. It returns &false; if the connection could - not be made. connection_string should be - a quoted string. - - - The arguments available for - connection_string includes - host, hostaddr, port, - dbname, user, - password, connect_timeout, - options, tty (ignored), sslmode, - requiressl (deprecated in favor of sslmode), and - service. Which of these arguments exist depends - on your PostgreSQL version. + connection_string. If a second call is made to pg_connect with - the same connection_string, no - new connection will be established unless you pass + the same connection_string as an existing connection, the + existing connection will be returned unless you pass PGSQL_CONNECT_FORCE_NEW as - connect_type, but instead, the connection - resource of the already opened connection will be returned. You - can have multiple connections to the same database if you use - different connection strings. + connect_type. The old syntax with multiple parameters @@ -54,6 +33,55 @@ + + &reftitle.parameters; + + + + connection_string + + + The connection_string can be empty to use all default parameters, or it + can contain one or more parameter settings separated by whitespace. + Each parameter setting is in the form keyword = value. Spaces around + the equal sign are optional. To write an empty value or a value + containing spaces, surround it with single quotes, e.g., keyword = + 'a value'. Single quotes and backslashes within the value must be + escaped with a backslash, i.e., \' and \\. + + + The currently recognized parameter keywords are: + host, hostaddr, port, + dbname, user, + password, connect_timeout, + options, tty (ignored), sslmode, + requiressl (deprecated in favor of sslmode), and + service. Which of these arguments exist depends + on your PostgreSQL version. + + + + + connect_type + + + If PGSQL_CONNECT_FORCE_NEW is passed, then a new connection + is created, even if the connection_string is identical to + an existing connection. + + + + + + + + + &reftitle.returnvalues; + + PostgreSQL connection resource on success, &false; on failure. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-num-fields.xml b/reference/pgsql/functions/pg-num-fields.xml index 0e0218a942..a050cead5b 100644 --- a/reference/pgsql/functions/pg-num-fields.xml +++ b/reference/pgsql/functions/pg-num-fields.xml @@ -1,10 +1,10 @@ - + pg_num_fields - Returns the number of fields + Returns the number of fields in a result @@ -15,10 +15,7 @@ pg_num_fields returns the number of fields - (columns) in a PostgreSQL result. The - argument is a result resource returned by - pg_query. This function will return -1 on - error. + (columns) in a PostgreSQL result resource. @@ -27,6 +24,57 @@ + + &reftitle.parameters; + + + + result + + + PostgreSQL query result resource, returned by pg_query, + pg_query_params or pg_execute + (among others). + + + + + + + + + &reftitle.returnvalues; + + The number of fields (columns) in the result. On error, -1 is returned. + + + + + &reftitle.examples; + + + <function>pg_num_fields</function> example + + +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-num-rows.xml b/reference/pgsql/functions/pg-num-rows.xml index f95d5ab23a..725affc705 100644 --- a/reference/pgsql/functions/pg-num-rows.xml +++ b/reference/pgsql/functions/pg-num-rows.xml @@ -1,10 +1,10 @@ - + pg_num_rows - Returns the number of rows + Returns the number of rows in a result @@ -15,17 +15,8 @@ pg_num_rows will return the number of rows in - a PostgreSQL result resource. - result is a query result resource returned - by pg_query. This function will return -1 on - error. + a PostgreSQL result resource. - - - Use pg_affected_rows to get number of rows - affected by INSERT, UPDATE and DELETE query. - - This function used to be called pg_numrows(). @@ -33,6 +24,57 @@ + + &reftitle.parameters; + + + + result + + + PostgreSQL query result resource, returned by pg_query, + pg_query_params or pg_execute + (among others). + + + + + + + + + &reftitle.returnvalues; + + The number of rows in the result. On error, -1 is returned. + + + + + &reftitle.examples; + + + <function>pg_num_rows</function> example + + +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; diff --git a/reference/pgsql/reference.xml b/reference/pgsql/reference.xml index f5a301a886..1adadfe989 100644 --- a/reference/pgsql/reference.xml +++ b/reference/pgsql/reference.xml @@ -1,5 +1,5 @@ - + PostgreSQL Functions PostgreSQL @@ -22,7 +22,7 @@ &reftitle.required; To use PostgreSQL support, you need PostgreSQL 6.5 or - later, PostgreSQL 7.4 or later to enable all PostgreSQL module + later, PostgreSQL 8.0 or later to enable all PostgreSQL module features. PostgreSQL supports many character encoding including multibyte character encoding. The current version and more information about PostgreSQL is available at