Note 002PHP data object (PDO) pre-defined constant

Source: Internet
Author: User
Tags error status code prefetch
Note 002PHP data object (PDO) predefined constant name description

PDO: PARAM_BOOL (integer) indicates the Boolean data type.

PDO: PARAM_NULL (integer) indicates the NULL data type in SQL.

PDO: PARAM_INT (integer) indicates an integer in SQL.

PDO: PARAM_STR (integer) indicates CHAR, VARCHAR, or other string types in SQL.

PDO: PARAM_LOB (integer) indicates the data type of large objects in SQL.

PDO: PARAM_STMT (integer) indicates the type of a record set. Currently, no driver is supported.

PDO: PARAM_INPUT_OUTPUT (integer) specifies the parameter as the INOUT parameter of a stored procedure. A specific PDO: PARAM _ * data type must be used with this value for bitwise OR.

PDO: FETCH_LAZY (integer) specifies the acquisition method. Each row in the result set is returned as an object. the variable name of this object corresponds to the column name. PDO: the variable name of the object to be accessed by FETCH_LAZY. Invalid in PDOStatement: fetchAll.

PDO: FETCH_ASSOC (integer) specifies the acquisition method. Each row in the corresponding result set is returned as an array indexed by the column name. If the result set contains multiple columns with the same name, only one value is returned for each column name of PDO: FETCH_ASSOC.

PDO: FETCH_NAMED (integer) specifies the acquisition method. Each row in the corresponding result set is returned as an array indexed by the column name. If the result set contains multiple columns with the same name, each column name of PDO: FETCH_ASSOC returns an array containing values.

PDO: FETCH_NUM (integer) specifies the acquisition method. Each row in the corresponding result set is returned as an array indexed by the column number, starting from column 0th.

PDO: FETCH_BOTH (integer) specifies the acquisition method. Each row in the corresponding result set is returned as an array indexed by the column number and column name, starting from column 0th.

PDO: FETCH_OBJ (integer) specifies the acquisition method. Each row in the result set is returned as an object of the column name corresponding to an attribute name.

PDO: FETCH_BOUND (integer) specifies the acquisition method, returns TRUE, and assigns the column values in the result set to PDOStatement: bindParam () or PDOStatement: bindColumn () PHP variable bound to the method.

PDO: FETCH_COLUMN (integer) specifies the acquisition method. the column is returned from the next row in the result set.

PDO: FETCH_CLASS (integer) specifies the acquisition method, returns a new instance of the requested class, and maps the column to the corresponding attribute name in the class. Note: If the requested class does not contain this attribute, the _ set () magic method is called.

PDO: FETCH_INTO (integer) specifies the acquisition method, updates an existing instance of a request class, and maps the column to the corresponding attribute name of the class.

PDO: FETCH_FUNC (integer) allows you to process data in full custom mode during running. (Valid only in PDOStatement: fetchAll ).

PDO: FETCH_GROUP (integer) returned by the value group. Usually used together with PDO: FETCH_COLUMN or PDO: FETCH_KEY_PAIR.

PDO: FETCH_UNIQUE (integer) only takes the unique value.

PDO: FETCH_KEY_PAIR (integer) gets a result set with two columns to an array. The first column is the key name and the second column is the value. Available from PHP 5.2.3.

PDO: FETCH_CLASSTYPE (integer) determines the class name based on the value of the first column.

PDO: FETCH_SERIALIZE (integer) is similar to PDO: FETCH_INTO, but the object is represented by a serialized string. Available from PHP 5.1.0. From PHP 5.3.0, if this flag is set, the class constructor will never be called.

PDO: FETCH_PROPS_LATE (integer) call the constructor before setting the property. Available from PHP 5.2.0.

PDO: ATTR_AUTOCOMMIT (integer) if this value is FALSE, PDO will try to disable automatic commit so that the database connection starts a transaction.

PDO: ATTR_PREFETCH (integer) sets the Prefetch size to balance the speed and memory usage of your application. Not all Database/driver combinations support setting the Prefetch size. The larger prefetch size leads to higher performance while occupying more memory.

PDO: ATTR_TIMEOUT (integer) specifies the number of timeout seconds for database connection.

PDO: ATTR_ERRMODE (integer) for more information about this attribute, see error and error handling.

PDO: ATTR_SERVER_VERSION (integer) this is a read-only attribute; returns the version information of the database service that the PDO connects.

PDO: ATTR_CLIENT_VERSION (integer) this is a read-only attribute; returns the version information of the client library used by the PDO driver.

PDO: ATTR_SERVER_INFO (integer) this is a read-only attribute. Returns metadata about the database service that the PDO connects.

PDO: ATTR_CONNECTION_STATUS (integer)

PDO: ATTR_CASE (integer) use a constant similar to PDO: CASE _ * to force the column name to the specified CASE.

PDO: ATTR_CURSOR_NAME (integer) to obtain or set the cursor name. It is useful when you use a scroll cursor and locate an update.

PDO: ATTR_CURSOR (integer) select the cursor type. PDO currently supports PDO: CURSOR_FWDONLY and PDO: CURSOR_SCROLL. It is usually PDO: CURSOR_FWDONLY, unless a scroll cursor is required.

PDO: ATTR_DRIVER_NAME (string) returns the driver name.

PDO: ATTR_ORACLE_NULLS (integer) converts an empty string to NULL in SQL when obtaining data.

PDO: ATTR_PERSISTENT (integer) requests a persistent connection instead of creating a new connection. For more information about this attribute, see connection and connection management.

PDO: ATTR_STATEMENT_CLASS (integer)

PDO: ATTR_FETCH_CATALOG_NAMES (integer) add the included directory name before each column name in the result set. The directory name and column name are separated by a decimal point (.). This attribute is supported at the driver level, so some drivers may not support this attribute.

PDO: ATTR_FETCH_TABLE_NAMES (integer) add the included table names to the front of each column name in the result set. The table name and column name are separated by a decimal point (.). This attribute is supported at the driver level, so some drivers may not support this attribute.

PDO: ATTR_STRINGIFY_FETCHES (integer)

PDO: ATTR_MAX_COLUMN_LEN (integer)

PDO: ATTR_DEFAULT_FETCH_MODE (integer) is available from PHP 5.2.0.

PDO: ATTR_EMULATE_PREPARES (integer) is available from PHP 5.1.3.

PDO: ERRMODE_SILENT (integer) if an error occurs, no error or exception is displayed. Developers are expected to explicitly check for errors. This is the default mode. For more information about this attribute, see error and error handling.

PDO: ERRMODE_WARNING (integer) if an error occurs, a PHP E_WARNING message is displayed. For more information about this attribute, see error and error handling.

PDO: ERRMODE_EXCEPTION (integer) if an error occurs, a PDOException is thrown. For more information about this attribute, see error and error handling.

PDO: CASE_NATURAL (integer) retains the name of the column returned by the database driver.

PDO: CASE_LOWER (integer) forces the column name to be lowercase.

PDO: CASE_UPPER (integer) forces the column name to be capitalized.

PDO: NULL_NATURAL (integer)

PDO: NULL_EMPTY_STRING (integer)

PDO: NULL_TO_STRING (integer)

PDO: FETCH_ORI_NEXT (integer) get the next row in the result set. Valid only for scroll cursors.

PDO: FETCH_ORI_PRIOR (integer) gets the last row in the result set. Valid only for scroll cursors.

PDO: FETCH_ORI_FIRST (integer) obtain the first row in the result set. Valid only for scroll cursors.

PDO: FETCH_ORI_LAST (integer) gets the last row in the result set. Valid only for scroll cursors.

PDO: FETCH_ORI_ABS (integer) obtain the required row from the result set based on the row number. Valid only for scroll cursors.

PDO: FETCH_ORI_REL (integer) obtains the required rows from the result set based on the relative position of the current cursor. Valid only for scroll cursors.

PDO: CURSOR_FWDONLY (integer) create a PDOStatement object that only enters the cursor. This is the default cursor option, because this cursor is the fastest and the most common data access mode in PHP.

PDO: CURSOR_SCROLL (integer) creates a PDOStatement object that can scroll cursors. Use the PDO: FETCH_ORI _ * constant to control the rows obtained in the result set.

PDO: ERR_NONE (string) corresponds to SQLSTATE '200', indicating that the SQL statement is successfully issued without errors or warnings. This constant is convenient when PDO: errorCode () or PDOStatement: errorCode () is used to determine whether an error occurs. The error status code returned by the preceding method is frequently used.

PDO: PARAM_EVT_ALLOC (integer) allocation event

PDO: PARAM_EVT_FREE (integer) unallocation event

PDO: PARAM_EVT_EXEC_PRE (integer) triggers an event before executing a preprocessing statement.

PDO: PARAM_EVT_EXEC_POST (integer) triggers an event after a preprocessing statement is executed.

PDO: PARAM_EVT_FETCH_PRE (integer) events triggered before a result is retrieved from a result set.

PDO: PARAM_EVT_FETCH_POST (integer) retrieves a result from a result set and triggers the event.

PDO: PARAM_EVT_NORMALIZE (integer) triggers an event when binding parameter registration allows the driver to normalize the variable name.

The above is the content of the pre-defined constant of the PHP Data object (PDO) in note 002. For more information, see PHP Chinese website (www.php1.cn )!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.