Note 002 PHP data Object (PDO) predefined constants

Source: Internet
Author: User
Tags prefetch
Name Description

PDO::P aram_bool (Integer) represents the Boolean data type.

PDO::P aram_null (integer) represents the NULL data type in SQL.

PDO::P aram_int (integer) represents an integral type in SQL.

PDO::P aram_str (integer) represents a CHAR, VARCHAR, or other string type in SQL.

PDO::P aram_lob (integer) represents the large object data type in SQL.

PDO::P aram_stmt (integer) represents a recordset type. Currently not supported by any driver.

PDO::P aram_input_output (integer) specifies that the parameter is a INOUT parameter for a stored procedure. You must use a definite PDO::P aram_* data type is bitwise OR with this value.

Pdo::fetch_lazy (integer) Specifies the fetch method that returns each row in the result set as an object with the variable name corresponding to the column name. Pdo::fetch_lazy creates the object variable name to access. is not valid in Pdostatement::fetchall ().

PDO::FETCH_ASSOC (integer) Specifies the fetch method that returns each row in the corresponding result set as an array indexed by the column name. If the result set contains more than one column with the same name, PDO::FETCH_ASSOC returns only one value per column name.

Pdo::fetch_named (integer) Specifies the fetch method that returns each row in the corresponding result set as an array indexed by the column name. If the result set contains more than one column with the same name, PDO::FETCH_ASSOC returns an array containing the values for each column name.

Pdo::fetch_num (integer) Specifies the fetch method that returns each row in the corresponding result set as an array indexed by the column number, starting at column No. 0.

Pdo::fetch_both (integer) Specifies the fetch method that returns each row in the corresponding result set as an array indexed by the column and column names, starting at column No. 0.

Pdo::fetch_obj (integer) Specifies the fetch method that returns each row in the result set as an object that corresponds to the column name of the property name.

Pdo::fetch_bound (integer) Specifies the fetch method, returns TRUE, and assigns the column value in the result set to the binding through the Pdostatement::bindparam () or Pdostatement::bindcolumn () method. PHP variable.

Pdo::fetch_column (integer) Specifies the fetch method, returning the required column from the next row in the result set.

Pdo::fetch_class (integer) Specifies the fetch method, returns a new instance of the requested class, and maps the column to the corresponding property name in the class. Note: If the property does not exist in the requested class, call the __set () Magic method

Pdo::fetch_into (integer) Specifies the fetch method, updates an existing instance of the request class, and maps the column to the corresponding property name in the class.

Pdo::fetch_func (integer) allows data to be processed completely in a custom manner in the run. (only valid in Pdostatement::fetchall ().)

Pdo::fetch_group (integer) is returned by value grouping. Usually used in conjunction with Pdo::fetch_column or Pdo::fetch_key_pair.

Pdo::fetch_unique (integer) only takes a unique value.

Pdo::fetch_key_pair (integer) Gets a result set of two columns into an array, where 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 represents an object as a serialized string. Available from PHP 5.1.0. Starting with PHP 5.3.0, if you set this flag, the constructor of the class will never be called.

Pdo::fetch_props_late (integer) to call the constructor before setting the property. Available from PHP 5.2.0.

Pdo::attr_autocommit (integer) If this value is FALSE, PDO tries to disable autocommit so that the database connection begins a transaction.

Pdo::attr_prefetch (integer) sets the prefetch size to balance the speed and memory usage for your app. Not all database/driver combinations support setting prefetch size. A larger prefetch size results in increased performance while also consuming more memory.

Pdo::attr_timeout (integer) sets the time-out number of seconds to connect to the database.

Pdo::attr_errmode (integer) For more information about this property, see the Error and Error handling section.

Pdo::attr_server_version (integer) This is a read-only property; Returns the version information of the database service to which PDO is connected.

Pdo::attr_client_version (integer) This is a read-only property; Returns the version information for the client library used by the PDO driver.

Pdo::attr_server_info (integer) This is a read-only property. Returns some meta information about the database service that PDO is connected to.

Pdo::attr_connection_status (integer)

Pdo::attr_case (integer) enforces the column name to the specified case with a constant similar to pdo::case_*.

Pdo::attr_cursor_name (integer) Gets or sets the name of the use cursor. Useful when using scrollable cursors and locating updates.

Pdo::attr_cursor (integer) selects the cursor type. PDO currently supports pdo::cursor_fwdonly and Pdo::cursor_scroll. Typically pdo::cursor_fwdonly, unless you do need a scrollable cursor.

Pdo::attr_driver_name (String) returns the driver name.

Pdo::attr_oracle_nulls (integer) converts an empty string to NULL in SQL when fetching data.

Pdo::attr_persistent (integer) requests a persistent connection, rather than creating a new connection. For more information about this property, see Connection and connection management.

Pdo::attr_statement_class (integer)

Pdo::attr_fetch_catalog_names (integer) adds the included directory name to each column name in the result set. The directory name and column name are separated by a decimal point (.). This property is supported at the drive level, so some drivers may not support this property.

Pdo::attr_fetch_table_names (integer) adds the table name that is contained in front of each column name in the result set. The table name and column name are separated by a decimal point (.). This property is supported at the drive level, so some drivers may not support this property.

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. You want the developer to explicitly check for errors. This is the default mode. For more information about this property, 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 property, see Error and error handling.

Pdo::errmode_exception (integer) throws an Pdoexception exception if an error occurs. For more information about this property, see Error and error handling.

Pdo::case_natural (integer) retains the column name returned by the database driver.

Pdo::case_lower (integer) enforces the column name lowercase.

Pdo::case_upper (integer) forces the column name to uppercase.

Pdo::null_natural (integer)

Pdo::null_empty_string (integer)

Pdo::null_to_string (integer)

Pdo::fetch_ori_next (integer) Gets the next row in the result set. Valid only for scrollable cursors.

Pdo::fetch_ori_prior (integer) Gets the previous row in the result set. Valid only for scrollable cursors.

Pdo::fetch_ori_first (integer) Gets the first row in the result set. Valid only for scrollable cursors.

Pdo::fetch_ori_last (integer) Gets the last row in the result set. Valid only for scrollable cursors.

Pdo::fetch_ori_abs (integer) Gets the required rows from the result set based on the line number. Valid only for scrollable cursors.

Pdo::fetch_ori_rel (integer) Gets the desired row from the result set based on the relative position of the current cursor position. Valid only for scrollable cursors.

Pdo::cursor_fwdonly (integer) Creates a Pdostatement object that is a forward-only cursor. This is the default cursor option because this cursor is the fastest and most commonly used data access mode in PHP.

Pdo::cursor_scroll (integer) creates a scrollable cursor for the Pdostatement object. The rows obtained in the result set are controlled by Pdo::fetch_ori_* constants.

Pdo::err_none (String) corresponds to SQLSTATE ' 00000 ', indicating that the SQL statement was successfully issued without error or warning. This constant is handy when using Pdo::errorcode () or Pdostatement::errorcode () to determine if an error occurs. It is often used when checking the error status codes returned by the above methods.

PDO::P aram_evt_alloc (integer) Assignment event

PDO::P aram_evt_free (integer) deallocation event

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

PDO::P aram_evt_exec_post (integer) executes a preprocessing statement after the event is triggered.

PDO::P aram_evt_fetch_pre (integer) triggers an event before extracting a result from a result set.

PDO::P aram_evt_fetch_post (integer) triggers an event after extracting a result from a result set.

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

The above is the note 002 PHP data Object (PDO) predefined constants of the content, more relevant content please pay attention to topic.alibabacloud.com (www.php.cn)!

  • Related Article

    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.