The following constants are defined by this extension module and are therefore only valid after the extension module is compiled into PHP or dynamically loaded at runtime.
Note: PDO uses class constants since PHP 5.1. Previous versions used a global constant of the form PDO_PARAM_BOOL.
PDO::PARAM_BOOL (integer) | Represents a Boolean data type. |
PDO::PARAM_NULL (integer) | Represents the NULL data type in SQL. |
PDO::PARAM_INT (integer) | Represents an integer type in SQL. |
PDO::PARAM_STR (integer) | Represents CHAR, VARCHAR, or other string types in SQL. |
PDO::PARAM_LOB (integer) | Represents the large object data type in SQL. |
PDO::PARAM_STMT (integer) | Represents a recordset type. It is not currently supported by any driver. |
PDO::PARAM_INPUT_OUTPUT (integer) | The specified parameter is an INOUT parameter of a stored procedure. This value must be bitwise ORed with an explicit PDO::PARAM_* data type. |
PDO::FETCH_LAZY (integer) | Specify the acquisition method and return each row in the result set as an object. The variable name of this object corresponds to the column name. PDO::FETCH_LAZY creates the object variable name for access. Not valid in PDOStatement::fetchAll(). |
PDO::FETCH_ASSOC (integer) | Specify the acquisition method and return each row in the corresponding result set as an array indexed by the column name. If the result set contains multiple columns with the same name, PDO::FETCH_ASSOC returns only one value per column name. |
PDO::FETCH_NAMED (integer) | Specify the acquisition method and return each row in the corresponding result set as an array indexed by the column name. If the result set contains multiple columns with the same name, PDO::FETCH_ASSOC returns an array containing values for each column name. |
PDO::FETCH_NUM (integer) | Specify the acquisition method and return each row in the corresponding result set as an array indexed by column number, starting from column 0. |
PDO::FETCH_BOTH (integer) | Specify the acquisition method and return each row in the corresponding result set as an array indexed by column number and column name, starting from column 0. |
PDO::FETCH_OBJ (integer) | Specify the acquisition method and return each row in the result set as an object whose attribute name corresponds to the column name. |
PDO::FETCH_BOUND (integer) | Specifies the acquisition method, returns TRUE and assigns the column value in the result set to the PHP variable bound through the PDOStatement::bindParam() or PDOStatement::bindColumn() method. |
PDO::FETCH_COLUMN (integer) | Specify the acquisition method to return the required column from the next row in the result set. |
PDO::FETCH_CLASS (integer) | Specify the acquisition method, return a new instance of the requested class, and map the column to the corresponding attribute name in the class. Note: If the attribute does not exist in the requested class, the __set() magic method is called |
PDO::FETCH_INTO (integer) | Specify the acquisition method, update an existing instance of the requested class, and map the column to the corresponding attribute name in the class. |
PDO::FETCH_FUNC (integer) | Allows for completely customizable processing of data on the fly. (Only valid in PDOStatement::fetchAll()). |
PDO::FETCH_GROUP (integer) | Returns grouped by value. Usually used with PDO::FETCH_COLUMN or PDO::FETCH_KEY_PAIR. |
PDO::FETCH_UNIQUE (integer) | Only take unique values. |
PDO::FETCH_KEY_PAIR (integer) | Get a result set with two columns into an array, where the first column is the key name and the second column is the value. Available since PHP 5.2.3. |
PDO::FETCH_CLASSTYPE (integer) | Determine the class name based on the value of the first column. |
PDO::FETCH_SERIALIZE (integer) | Like PDO::FETCH_INTO, but represents the object as a serialized string. Available since PHP 5.1.0. Starting with PHP 5.3.0, if this flag is set, the class's constructor is never called. |
PDO::FETCH_PROPS_LATE (integer) | Call the constructor before setting properties. Available since PHP 5.2.0. |
PDO::ATTR_AUTOCOMMIT (integer) | If this value is FALSE, PDO will attempt to disable autocommit so that the database connection can start a transaction. |
PDO::ATTR_PREFETCH (integer) | Set the prefetch size to balance speed and memory usage for your application. Not all database/driver combinations support setting the prefetch size. Larger prefetch sizes result in improved performance but also consume more memory. |
PDO::ATTR_TIMEOUT (integer) | Set the timeout seconds for connecting to the database. |
PDO::ATTR_ERRMODE (integer) | See the Errors and Error Handling section for more information about this property. |
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 of 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 to which PDO is connected. |
PDO::ATTR_CONNECTION_STATUS (integer) | |
PDO::ATTR_CASE (integer) | Use constants like PDO::CASE_* to force column names to the specified case. |
PDO::ATTR_CURSOR_NAME (integer) | Gets or sets the name of the cursor to use. Very useful when using scrollable cursors and positioned updates. |
PDO::ATTR_CURSOR (integer) | Select the cursor type. PDO currently supports PDO::CURSOR_FWDONLY and PDO::CURSOR_SCROLL. Generally PDO::CURSOR_FWDONLY, unless a scrollable cursor is really needed. |
PDO::ATTR_DRIVER_NAME (string) | Returns the driver name. Example using PDO::ATTR_DRIVER_NAME: <?phpif ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') { echo "Running on mysql; doing something mysql specific heren";}?> |
PDO::ATTR_ORACLE_NULLS (integer) | Convert empty strings to NULL in SQL when retrieving data. |
PDO::ATTR_PERSISTENT (integer) | Requests a persistent connection instead of creating a new one. See Connections and Connection Management for more information about this property. |
PDO::ATTR_STATEMENT_CLASS (integer) | |
PDO::ATTR_FETCH_CATALOG_NAMES (integer) | Appends the containing directory name to the front of each column name in the result set. Directory names and column names are separated by a decimal point (.). This property is supported at the driver level, so some drivers may not support this property. |
PDO::ATTR_FETCH_TABLE_NAMES (integer) | Appends the included table name to the front of each column name in the result set. Table names and column names are separated by a decimal point (.). This property is supported at the driver 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) | Available since PHP 5.2.0. |
PDO::ATTR_EMULATE_PREPARES (integer) | Available since PHP 5.1.3. |
PDO::ERRMODE_SILENT (integer) | If an error occurs, no error or exception is displayed. Hopefully developers will check for errors explicitly. This is the default mode. See Errors and Error Handling for more information about this property. |
PDO::ERRMODE_WARNING (integer) | If an error occurs, a PHP E_WARNING message is displayed. See Errors and Error Handling for more information about this property. |
PDO::ERRMODE_EXCEPTION (integer) | If an error occurs, a PDOException is thrown. See Errors and Error Handling for more information about this property. |
PDO::CASE_NATURAL (integer) | Preserve the column names returned by the database driver. |
PDO::CASE_LOWER (integer) | Force column names to lowercase. |
PDO::CASE_UPPER (integer) | Force column names to be uppercase. |
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 scrollable cursors. |
PDO::FETCH_ORI_PRIOR (integer) | Get the previous row in the result set. Valid only for scrollable cursors. |
PDO::FETCH_ORI_FIRST (integer) | Get the first row in the result set. Valid only for scrollable cursors. |
PDO::FETCH_ORI_LAST (integer) | Get the last row in the result set. Valid only for scrollable cursors. |
PDO::FETCH_ORI_ABS (integer) | Get the required rows from the result set based on the row number. Valid only for scrollable cursors. |
PDO::FETCH_ORI_REL (integer) | Gets the required rows from the result set based on their relative position to the current cursor position. Valid only for scrollable cursors. |
PDO::CURSOR_FWDONLY (integer) | Create a PDOStatement object that is an advance-only 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 for a scrollable cursor. Control the rows fetched in the result set through the PDO::FETCH_ORI_* constants. |
PDO::ERR_NONE (string) | Corresponds to SQLSTATE '00000', indicating that the SQL statement was successfully issued without errors or warnings. This constant is convenient when using PDO::errorCode() or PDOStatement::errorCode() to determine whether an error occurred. Often used when checking error status codes returned by the above methods. |
PDO::PARAM_EVT_ALLOC (integer) | Assign events |
PDO::PARAM_EVT_FREE (integer) | deallocation event |
PDO::PARAM_EVT_EXEC_PRE (integer) | Fires an event before executing a prepared statement. |
PDO::PARAM_EVT_EXEC_POST (integer) | Triggers an event after executing a prepared statement. |
PDO::PARAM_EVT_FETCH_PRE (integer) | Event triggered before retrieving a result from a result set. |
PDO::PARAM_EVT_FETCH_POST (integer) | The event is triggered after a result is retrieved from a result set. |
PDO::PARAM_EVT_NORMALIZE (integer) | Events fired when binding parameter registration allows the driver to normalize variable names. |