Перечисленные ниже константы определены данным расширением и могут быть
доступны только в том случае, если PHP был собран с
поддержкой этого расширения или же в том случае, если
данное расширение подгружается во время выполнения.
Внимание
PDO uses class constants since PHP 5.1. Prior releases use global constants
in the form PDO_PARAM_BOOL.
Specifies that the fetch method shall return each row as an object with
variable names that correspond to the column names returned in the result
set. PDO::FETCH_LAZY creates the object variable names as they are accessed.
Specifies that the fetch method shall return each row as an array indexed
by column name as returned in the corresponding result set. If the result
set contains multiple columns with the same name, PDO::FETCH_ASSOC returns
only a single value per column name.
Specifies that the fetch method shall return each row as an array indexed
by column name as returned in the corresponding result set. If the result
set contains multiple columns with the same name, PDO::FETCH_NAMED returns
an array of values per column name.
Specifies that the fetch method shall return each row as an array indexed
by column number as returned in the corresponding result set, starting at
column 0.
Specifies that the fetch method shall return each row as an array indexed
by both column name and number as returned in the corresponding result set,
starting at column 0.
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() or
PDOStatement::bindColumn() methods.
Setting the prefetch size allows you to balance speed against memory
usage for your application. Not all database/driver combinations support
setting of the prefetch size. A larger prefetch size results in
increased performance at the cost of higher memory usage.
Selects the cursor type. PDO currently supports either
PDO::CURSOR_FWDONLY and
PDO::CURSOR_SCROLL. Stick with
PDO::CURSOR_FWDONLY unless you know that you need a
scrollable cursor.
Request a persistent connection, rather than creating a new connection.
See Connections and Connection
management for more information on this attribute.
Prepend the containing catalog name to each column name returned in the
result set. The catalog name and column name are separated by a decimal
(.) character. Support of this attribute is at the driver level; it may
not be supported by your driver.
Prepend the containing table name to each column name returned in the
result set. The table name and column name are separated by a decimal (.)
character. Support of this attribute is at the driver level; it may not
be supported by your driver.
Do not raise an error or exception if an error occurs. The developer is
expected to explicitly check for errors. This is the default mode.
See Errors and error handling
for more information about this attribute.
Create a PDOStatement object with a forward-only cursor. This is the
default cursor choice, as it is the fastest and most common data access
pattern in PHP.
Corresponds to SQLSTATE '00000', meaning that the SQL statement was
successfully issued with no errors or warnings. This constant is for
your convenience when checking PDO::errorCode() or
PDOStatement::errorCode() to determine if an error
occurred. You will usually know if this is the case by examining the
return code from the method that raised the error condition anyway.