1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
|
<?xml version='1.0' encoding="utf-8"?>
<!-- $Revision: 297078 $ -->
<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>
</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>
</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.
</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>
</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
-->
|