MySQL Functions (PDO_MYSQL) (
MySQL (PDO)
)
2521
initiated successfully. In addition, any DDL queries issued will implicitly commit
any pending transactions.
Use
--with-pdo-mysql[=DIR]
to install the PDO MySQL extension, where the optional
[=DIR]
is
the MySQL base install directory. If
mysqlnd
is passed as
[=DIR]
, then the MySQL native driver will
be used.
Optionally, the
--with-mysql-sock[=DIR]
sets to location to the MySQL unix socket pointer for all
MySQL extensions, including PDO_MYSQL. If unspecified, the default locations are searched.
Optionally, the
--with-zlib-dir[=DIR]
is used to set the path to the libz install prefix.
$ ./configure --with-pdo-mysql --with-mysql-sock=/var/mysql/mysql.sock
SSL support is enabled using the appropriate
PDO_MySQL constants [2521]
, which is equivalent
to calling the
MySQL C API function mysql_ssl_set()
. Also, SSL cannot be enabled with
PDO::setAttribute
because the connection already exists. See also the MySQL documentation
about
connecting to MySQL with SSL
.
Table 20.55. Changelog
Version
Description
5.4.0
MySQL client libraries 4.1 and below are no longer
supported.
5.3.9
Added SSL support with mysqlnd and OpenSSL.
5.3.7
Added SSL support with libmysqlclient and
OpenSSL.
The constants below are defined by this driver, and will only be available when the extension has
been either compiled into PHP or dynamically loaded at runtime. In addition, these driver-specific
constants should only be used if you are using this driver. Using driver-specific attributes with
another driver may result in unexpected behaviour.
PDO::getAttribute
may be used to obtain the
PDO_ATTR_DRIVER_NAME
attribute to check the driver, if your code can run against multiple drivers.
PDO::MYSQL_ATTR_USE_BUFFERED_QUERY
(integer)
If this attribute is set to
TRUE
on a
PDOStatement
, the MySQL
driver will use the buffered versions of the MySQL API. If you're
writing portable code, you should use
PDOStatement::fetchAll
instead.
Example 20.212. Forcing queries to be buffered in mysql
<?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");
}
?>
PDO::MYSQL_ATTR_LOCAL_INFILE
(integer)
Enable
LOAD LOCAL INFILE
.
Note, this constant can only be used in the
driver_options
array
when constructing a new database handle.
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...