php-doc-en/reference/pdo/constants.xml

681 lines
17 KiB
XML
Raw Normal View History

<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.11 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<section id="pdo.constants">
&reftitle.constants;
&extension.constants;
<variablelist>
<varlistentry>
<term>
<constant>PDO_PARAM_BOOL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents a boolean data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_NULL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents the SQL NULL data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_INT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents the SQL INTEGER data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_STR</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents the SQL CHAR, VARCHAR, or other string data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_LOB</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents the SQL large object data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_STMT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Represents a recordset type. Not currently supported by any drivers.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_PARAM_INPUT_OUTPUT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the parameter is an INOUT parameter for a stored
procedure. You must bitwise-OR this value with an explicit
PDO_PARAM_* data type.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_LAZY</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ASSOC</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_NAMED</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_NUM</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_BOTH</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_OBJ</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the fetch method shall return each row as an object with
property names that correspond to the column names returned in the result
set.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_BOUND</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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 <function>PDOStatement::bindParam</function> or
<function>PDOStatement::bindColumn</function> methods.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_COLUMN</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the fetch method shall return only a single requested
column from the next row in the result set.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_CLASS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the fetch method shall return a new instance of the
requested class, mapping the columns to named properties in the class.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_INTO</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Specifies that the fetch method shall update an existing instance of the
requested class, mapping the columns to named properties in the class.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_FUNC</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_GROUP</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_UNIQUE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_CLASSTYPE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_AUTOCOMMIT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
If this value is &false;, PDO attempts to disable autocommit so that the
connection begins a transaction.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_PREFETCH</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_TIMEOUT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Sets the timeout value in seconds for communications with the database.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_ERRMODE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
See the <link linkend='pdo.error-handling'>Errors and error
handling</link> section for more information about this attribute.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_SERVER_VERSION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
This is a read only attribute; it will return information about the
version of the database server to which PDO is connected.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_CLIENT_VERSION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
This is a read only attribute; it will return information about the
version of the client libraries that the PDO driver is using.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_SERVER_INFO</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
This is a read only attribute; it will return some meta information about the
database server to which PDO is connected.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_CONNECTION_STATUS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_CASE</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Force column names to a specific case specified by the PDO_CASE_*
constants.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_CURSOR_NAME</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Get or set the name to use for a cursor. Most useful when using
scrollable cursors and positioned updates.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_CURSOR</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Selects the cursor type. PDO currently supports either
<constant>PDO_CURSOR_FWDONLY</constant> and
<constant>PDO_CURSOR_SCROLL</constant>. Stick with
<constant>PDO_CURSOR_FWDONLY</constant> unless you know that you need a
scrollable cursor.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_DRIVER_NAME</constant>
(<type>string</type>)
</term>
<listitem>
<simpara>
Returns the name of the driver.
</simpara>
<para>
<example><title>using PDO_ATTR_DRIVER_NAME</title>
<programlisting role='php'>
<![CDATA[
<?php
if ($db->getAttribute(PDO_ATTR_DRIVER_NAME) == 'mysql') {
echo "Running on mysql; doing something mysql specific here\n";
}
?>
]]>
</programlisting>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_ORACLE_NULLS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Convert empty strings to SQL NULL values on data fetches.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_PERSISTENT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Request a persistent connection, rather than creating a new connection.
See <link linkend='pdo.connections'>Connections and Connection
management</link> for more information on this attribute.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_FETCH_CATALOG_NAMES</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ATTR_FETCH_TABLE_NAMES</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ERRMODE_SILENT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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 <link linkend='pdo.error-handling'>Errors and error handling</link>
for more information about this attribute.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ERRMODE_WARNING</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Issue a PHP E_WARNING message if an error occurs.
See <link linkend='pdo.error-handling'>Errors and error handling</link>
for more information about this attribute.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ERRMODE_EXCEPTION</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Throw a <classname>PDOException</classname> if an error occurs.
See <link linkend='pdo.error-handling'>Errors and error handling</link>
for more information about this attribute.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_CASE_NATURAL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Leave column names as returned by the database driver.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_CASE_LOWER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Force column names to lower case.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_CASE_UPPER</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Force column names to upper case.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_NEXT</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the next row in the result set. Valid only for scrollable cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_PRIOR</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the previous row in the result set. Valid only for scrollable
cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_FIRST</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the first row in the result set. Valid only for scrollable cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_LAST</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the last row in the result set. Valid only for scrollable cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_ABS</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the requested row by row number from the result set. Valid only
for scrollable cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_FETCH_ORI_REL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Fetch the requested row by relative position from the current position
of the cursor in the result set. Valid only for scrollable cursors.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_CURSOR_FWDONLY</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
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.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_CURSOR_SCROLL</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
Create a PDOStatement object with a scrollable cursor. Pass the
PDO_FETCH_ORI_* constants to control the rows fetched from the result set.
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO_ERR_NONE</constant>
(<type>string</type>)
</term>
<listitem>
<simpara>
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 <function>PDO::errorCode</function> or
<function>PDOStatement::errorCode</function> 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.
</simpara>
</listitem>
</varlistentry>
</variablelist>
</section>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"../../../../manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->