diff --git a/reference/pdo/constants.xml b/reference/pdo/constants.xml index e5a9d14fb2..11c9686914 100644 --- a/reference/pdo/constants.xml +++ b/reference/pdo/constants.xml @@ -1,5 +1,5 @@ - +
&reftitle.constants; @@ -133,7 +133,7 @@ Specifies that the fetch method shall return TRUE and assign the values of the columns in the result set to the PHP variables to which they were - bound with the PDOStatement::bindParam() method. + bound with the PDOStatement::bindParam method. diff --git a/reference/pdo/functions/PDO-construct.xml b/reference/pdo/functions/PDO-construct.xml index 84589fe519..0c86ea43f1 100644 --- a/reference/pdo/functions/PDO-construct.xml +++ b/reference/pdo/functions/PDO-construct.xml @@ -1,10 +1,10 @@ - + PDO::__construct - Creates a PDO instance to represent a connection to a database + Creates a PDO instance representing a connection to a database @@ -19,49 +19,101 @@ &warn.experimental.func; Creates a PDO instance to represent a connection to the requested - database. The dsn parameter supports three - different methods of specifying the arguments required to create - a database connection: + database. + + + + &reftitle.parameters; + - Driver invocation + dsn - dsn consists of the PDO driver name, followed - by a colon, followed by the PDO driver-specific connection syntax. - For example, 'odbc:DSN=SAMPLE;UID=db2inst1;PWD=ibmdb2' - would create a PDO_ODBC connection to an ODBC database, while - 'mysql:host=127.0.0.1;dbname=testdb' would create - a PDO_MYSQL connection to a MySQL database. + The dsn parameter supports three + different methods of specifying the arguments required to create + a database connection: + + Driver invocation + + + dsn consists of the PDO driver name, followed + by a colon, followed by the PDO driver-specific connection syntax. + For example, 'odbc:DSN=SAMPLE;UID=db2inst1;PWD=ibmdb2' + would create a PDO_ODBC connection to an ODBC database, while + 'mysql:host=127.0.0.1;dbname=testdb' would create + a PDO_MYSQL connection to a MySQL database. + + + + URI invocation + + + dsn consists of uri: + followed by a URI that defines the location of a file containing + the DSN string. The URI can specify a local file or a remote URL. + + + + Aliasing + + + dsn consists of a name + name that maps to + pdo.dsn.name in &php.ini; + defining the DSN string. name can not contain + a colon. + + + + - URI invocation + username - dsn consists of uri: - followed by a URI that defines the location of a file containing - the DSN string. The URI can specify a local file or a remote URL. + The user name, if required, for the DSN string. - Aliasing + password - dsn consists of a name - name that maps to - pdo.dsn.name in &php.ini; - defining the DSN string. name can not contain - a colon. + The password, if required, for the DSN string. + + + + driver_opts + + + A key => value array of driver-specific connection options. - If username or password - are not required to complete the connection, you must pass empty strings - or the constructor will throw a PDOException exception. - Create a PDO instance via driver invocation - + + + + &reftitle.returnvalues; + + Returns a PDO object on success. + + + + + &reftitle.exceptions; + + PDO::construct throws a PDOException if the attempt + to connect to the requested database fails. + + + + + &reftitle.examples; + + Create a PDO instance via driver invocation + ]]> - - - Create a PDO instance via URI invocation - - The following example assumes that the file - /usr/local/dbconnect exists with file permissions - that enable PHP to read the file. The file contains the PDO DSN to - connect to a DB2 database through the PDO_ODBC driver: - - + + + Create a PDO instance via URI invocation + + The following example assumes that the file + /usr/local/dbconnect exists with file permissions + that enable PHP to read the file. The file contains the PDO DSN to + connect to a DB2 database through the PDO_ODBC driver: + + - - - The PHP script can then create a database connection by simply - passing the uri: parameter and pointing to - the file URI: - - + + + The PHP script can then create a database connection by simply + passing the uri: parameter and pointing to + the file URI: + + ]]> - - - Create a PDO instance using an alias - - The following example assumes that &php.ini; contains the following - entry to enable a connection to a MySQL database using only the - alias mydb: - pdo.dsn.mydb=mysql:dbname=testdb;host=127.0.0.1 - - + + + Create a PDO instance using an alias + + The following example assumes that &php.ini; contains the following + entry to enable a connection to a MySQL database using only the + alias mydb: + pdo.dsn.mydb=mysql:dbname=testdb;host=127.0.0.1 + + ]]> - - + + + diff --git a/reference/pdo/functions/PDOStatement-rowCount.xml b/reference/pdo/functions/PDOStatement-rowCount.xml index 8f8e8c21c1..74bd0703d6 100644 --- a/reference/pdo/functions/PDOStatement-rowCount.xml +++ b/reference/pdo/functions/PDOStatement-rowCount.xml @@ -1,5 +1,5 @@ - + @@ -31,6 +31,7 @@ Return the number of deleted rows prepare('DELETE FROM fruit'); $del->execute(); @@ -39,6 +40,7 @@ $del->execute(); print("Return number of rows that were deleted:\n"); $count = $del->rowCount(); print("Deleted $count rows.\n"); +?> ]]> diff --git a/reference/pdo/functions/PDOStatement-setFetchMode.xml b/reference/pdo/functions/PDOStatement-setFetchMode.xml index e54ee76edf..e700a4a8c5 100644 --- a/reference/pdo/functions/PDOStatement-setFetchMode.xml +++ b/reference/pdo/functions/PDOStatement-setFetchMode.xml @@ -1,11 +1,11 @@ - + PDOStatement::setFetchMode - Returns meta data for a numbered column + Set the default fetch mode for this statement @@ -15,7 +15,7 @@ intmode - &warn.undocumented.func; + &warn.experimental.func; @@ -26,72 +26,44 @@ mode - Its description + The fetch mode must be one of the PDO_FETCH_* constants. + &reftitle.returnvalues; - What the function returns, first on success, then on failure. See - also the &return.success; entity + Returns 1 on success or &false; on failure. - - - - - - - -