php-doc-en/reference/pdo_mysql/constants.xml
Kalle Sommer Nielsen dbb1dd6cfe Fixed bug ( PDO::MYSQL_ATTR_LOCAL_INFILE cause error always)
# Also fixed this for PDO::MYSQL_ATTR_INIT_COMMAND

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@304657 c90b9560-bf6c-de11-be94-00142212c4b1
2010-10-23 12:50:27 +00:00

177 lines
4.6 KiB
XML

<?xml version='1.0' encoding="utf-8"?>
<!-- $Revision$ -->
<section xml:id="pdo-mysql.constants" xmlns="http://docbook.org/ns/docbook">
&reftitle.constants;
&pdo.driver-constants;
<variablelist>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_USE_BUFFERED_QUERY</constant>
(<type>integer</type>)
</term>
<listitem>
<simpara>
If this attribute is set to &true; on a
<classname>PDOStatement</classname>, the MySQL driver will use the
buffered versions of the MySQL API. If you're writing portable code, you
should use <function>PDOStatement::fetchAll</function> instead.
</simpara>
<para>
<example><title>Forcing queries to be buffered in mysql</title>
<programlisting role='php'>
<![CDATA[
<?php
if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'mysql') {
$stmt = $db->prepare('select * from foo',
array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => true));
} else {
die("my application only works with mysql; I should use \$stmt->fetchAll() instead");
}
?>
]]>
</programlisting>
</example>
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_LOCAL_INFILE</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Enable <literal>LOAD LOCAL INFILE</literal>.
</para>
<para>
Note, this constant can only be used in the <parameter>driver_options</parameter>
array when constructing a new database handle.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_INIT_COMMAND</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Command to execute when connecting to the MySQL server. Will
automatically be re-executed when reconnecting.
</para>
<para>
Note, this constant can only be used in the <parameter>driver_options</parameter>
array when constructing a new database handle.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_READ_DEFAULT_FILE</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Read options from the named option file instead of from
<filename>my.cnf</filename>. This option is not available if
mysqlnd is used, because mysqlnd does not read the mysql
configuration files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_READ_DEFAULT_GROUP</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Read options from the named group from <filename>my.cnf</filename> or the
file specified with <constant>MYSQL_READ_DEFAULT_FILE</constant>. This option
is not available if mysqlnd is used, because mysqlnd does not read the mysql
configuration files.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_MAX_BUFFER_SIZE</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Maximum buffer size. Defaults to 1 MiB. This constant is not supported when
compiled against mysqlnd.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_DIRECT_QUERY</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Perform direct queries, don't use prepared statements.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_FOUND_ROWS</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Return the number of found (matched) rows, not the
number of changed rows.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_IGNORE_SPACE</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Permit spaces after function names. Makes all functions
names reserved words.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term>
<constant>PDO::MYSQL_ATTR_COMPRESS</constant>
(<type>integer</type>)
</term>
<listitem>
<para>
Enable network communication compression. This is not supported when
compiled against mysqlnd.
</para>
</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:"~/.phpdoc/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
-->