The PDO class

Introduction

(PHP 5 >= 5.1.0, PHP 7, PECL pdo >= 0.1.0)

Represents a connection between PHP and a database server.

Class synopsis

PDO {
public __construct ( string $dsn [, string $username [, string $passwd [, array $options ]]] )
public beginTransaction ( ) : bool
public commit ( ) : bool
public errorCode ( ) : string
public errorInfo ( ) : array
public exec ( string $statement ) : int
public getAttribute ( int $attribute ) : mixed
public static getAvailableDrivers ( ) : array
public inTransaction ( ) : bool
public lastInsertId ([ string $name = null ] ) : string
public prepare ( string $statement [, array $driver_options = array() ] ) : PDOStatement
public query ( string $statement ) : PDOStatement
public quote ( string $string [, int $parameter_type = PDO::PARAM_STR ] ) : string
public rollBack ( ) : bool
public setAttribute ( int $attribute , mixed $value ) : bool
}

Table of Contents

© 1997–2020 The PHP Documentation Group
Licensed under the Creative Commons Attribution License v3.0 or later.
https://www.php.net/manual/en/class.pdo.php