Attributes

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@199766 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Jakub Vrana 2005-11-02 09:47:10 +00:00
parent 6f01457ef9
commit 327958eb18
4 changed files with 68 additions and 38 deletions

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.7 $ -->
<!-- $Revision: 1.8 $ -->
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDO-getAttribute">
<refnamediv>
@ -76,39 +76,16 @@
<![CDATA[
<?php
$conn = new PDO('odbc:sample', 'db2inst1', 'ibmdb2');
$attributes = array(
"AUTOCOMMIT", "ERRMODE", "CASE", "CLIENT_VERSION", "CONNECTION_STATUS",
"ORACLE_NULLS", "PERSISTENT", "PREFETCH", "SERVER_INFO", "SERVER_VERSION",
"TIMEOUT"
);
print "\nPDO::ATTR_AUTOCOMMIT: ";
print $conn->getAttribute(PDO::ATTR_AUTOCOMMIT);
print "\nPDO::ATTR_ERRMODE: ";
print $conn->getAttribute(PDO::ATTR_ERRMODE);
print "\nPDO::ATTR_CASE: ";
print $conn->getAttribute(PDO::ATTR_CASE);
print "\nPDO::ATTR_CLIENT_VERSION: ";
print $conn->getAttribute(PDO::ATTR_CLIENT_VERSION);
print "\nPDO::ATTR_CONNECTION_STATUS: ";
print $conn->getAttribute(PDO::ATTR_CONNECTION_STATUS);
print "\nPDO::ATTR_ORACLE_NULLS: ";
print $conn->getAttribute(PDO::ATTR_ORACLE_NULLS);
print "\nPDO::ATTR_PERSISTENT: ";
print $conn->getAttribute(PDO::ATTR_PERSISTENT);
print "\nPDO::ATTR_PREFETCH: ";
print $conn->getAttribute(PDO::ATTR_PREFETCH);
print "\nPDO::ATTR_SERVER_INFO: ";
print $conn->getAttribute(PDO::ATTR_SERVER_INFO);
print "\nPDO::ATTR_SERVER_VERSION: ";
print $conn->getAttribute(PDO::ATTR_SERVER_VERSION);
print "\nPDO::ATTR_TIMEOUT: ";
print $conn->getAttribute(PDO::ATTR_TIMEOUT);
foreach ($attributes as $val) {
echo "PDO::ATTR_$val: ";
echo $conn->getAttribute(constant("PDO::ATTR_$val")) . "\n";
}
?>
]]>
</programlisting>

View file

@ -1,5 +1,5 @@
<?xml version='1.0' encoding='iso-8859-1'?>
<!-- $Revision: 1.5 $ -->
<!-- $Revision: 1.6 $ -->
<!-- Generated by xml_proto.php v2.1. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDO-setAttribute">
<refnamediv>
@ -36,6 +36,45 @@
</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para><literal>PDO::ATTR_ERRMODE</literal>: Error reporting.
<itemizedlist>
<listitem><para><literal>PDO::ERRMODE_SILENT</literal>:
Just set error codes.</para></listitem>
<listitem><para><literal>PDO::ERRMODE_WARNING</literal>:
Raise <link linkend="e-warning">E_WARNING</link>.</para></listitem>
<listitem><para><literal>PDO::ERRMODE_EXCEPTION</literal>:
Throw <link linkend="language.exceptions">exceptions</link>.</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para><literal>PDO::ATTR_ORACLE_NULLS</literal>
(available with all drivers, not just Oracle):
Conversion of NULL and empty strings.
<itemizedlist>
<listitem><para><literal>PDO::NULL_NATURAL</literal>:
No conversion.</para></listitem>
<listitem><para><literal>PDO::NULL_EMPTY_STRING</literal>:
Empty string is converted to &null;.</para></listitem>
<listitem><para><literal>PDO::NULL_TO_STRING</literal>:
NULL is converted to an empty string.</para></listitem>
</itemizedlist>
</para></listitem>
<listitem><para><literal>PDO::ATTR_STRINGIFY_FETCHES</literal>:
Convert numeric values to strings when fetching.
Requires <type>bool</type>.
</para></listitem>
<listitem><para><literal>PDO::ATTR_STATEMENT_CLASS</literal>:
Set user-supplied statement class derived from PDOStatement.
Cannot be used with persistent PDO instances.
Requires <literal>array(string classname, array(mixed ctor_args))</literal>.
</para></listitem>
<listitem><para><literal>PDO::ATTR_AUTOCOMMIT</literal>
(available in OCI, Firebird and MySQL):
Whether to autocommit every single statement.
</para></listitem>
<listitem><para><literal>PDO::MYSQL_ATTR_USE_BUFFERED_QUERY</literal>
(available in MySQL):
Use buffered queries.
</para></listitem>
</itemizedlist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDOStatement-getAttribute">
<refnamediv>
@ -15,7 +15,14 @@
<methodparam><type>int</type><parameter>attribute</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<para>
Gets an attribute of the statement. Currently, no generic attributes exist but only driver specific:
<itemizedlist>
<listitem><para><literal>PDO::ATTR_CURSOR_NAME</literal> (Firebird specific):
Get the name of cursor.
</para></listitem>
</itemizedlist>
</para>
</refsect1>

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.2 $ -->
<!-- $Revision: 1.3 $ -->
<!-- Generated by xml_proto.php v2.2. Found in /scripts directory of phpdoc. -->
<refentry id="function.PDOStatement-setAttribute">
<refnamediv>
@ -16,7 +16,14 @@
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
</methodsynopsis>
&warn.undocumented.func;
<para>
Sets an attribute on the statement. Currently, no generic attributes are set but only driver specific:
<itemizedlist>
<listitem><para><literal>PDO::ATTR_CURSOR_NAME</literal> (Firebird specific):
Set the name of cursor.
</para></listitem>
</itemizedlist>
</para>
</refsect1>