(PHP 8 >= 8.4.0)
A PDO subclass representing a connection using the MySQL PDO driver.
This driver supports a dedicated SQL query parser for the MySQL dialect. It can handle the following:
$dsn
,$username
= null
,$password
= null
,$options
= null
$dsn
,$username
= null
,$password
= null
,$options
= null
$query
, ?int $fetchMode
= PDO::FETCH_COLUMN, int $colno
): PDOStatement|false$query
,$fetchMode
= PDO::FETCH_CLASS,$classname
,$constructorArgs
$query
, ?int $fetchMode
= PDO::FETCH_INTO, object $object
): PDOStatement|falsePdo\Mysql::ATTR_USE_BUFFERED_QUERY
false
on a
Pdo\Mysql object,
the MySQL driver will use the unbuffered mode.
Beispiel #1 Setting MySQL unbuffered mode
<?php
$pdo = new Pdo\Mysql("mysql:host=localhost;dbname=world", 'my_user', 'my_password');
$pdo->setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, false);
$unbufferedResult = $pdo->query("SELECT Name FROM City");
foreach ($unbufferedResult as $row) {
echo $row['Name'] . PHP_EOL;
}
?>
Pdo\Mysql::ATTR_LOCAL_INFILE
LOAD LOCAL INFILE
.
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_LOCAL_INFILE_DIRECTORY
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_INIT_COMMAND
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_READ_DEFAULT_FILE
Hinweis: This option is not available if mysqlnd is used, because mysqlnd does not read the mysql configuration files.
Pdo\Mysql::ATTR_READ_DEFAULT_GROUP
Pdo\Mysql::ATTR_READ_DEFAULT_FILE
.
Hinweis: This option is not available if mysqlnd is used, because mysqlnd does not read the mysql configuration files.
Pdo\Mysql::ATTR_COMPRESS
Pdo\Mysql::ATTR_DIRECT_QUERY
PDO::ATTR_EMULATE_PREPARES
.
Pdo\Mysql::ATTR_FOUND_ROWS
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_IGNORE_SPACE
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_MAX_BUFFER_SIZE
Hinweis: This constant is not supported when compiled against mysqlnd.
Pdo\Mysql::ATTR_MULTI_STATEMENTS
false
.
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SERVER_PUBLIC_KEY
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_KEY
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_CERT
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_CA
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_CAPATH
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_CIPHER
DHE-RSA-AES256-SHA:AES128-SHA
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.
Pdo\Mysql::ATTR_SSL_VERIFY_SERVER_CERT
Hinweis: This option is available only with mysqlnd.
Hinweis: Can only be used in the
driver_options
array when constructing a new database handle.