The PDOStatement class

(PHP 5 >= 5.1.0, PHP 7, PHP 8, PECL pdo >= 1.0.0)

Introduction

Represents a prepared statement and, after the statement is executed, an associated result set.

Class synopsis

classPDOStatementimplementsIteratorAggregate {
publicbindColumn(
    string|int$column,
    mixed&$var,
    int$type = PDO::PARAM_STR,
    int$maxLength = 0,
    mixed$driverOptions = null
): bool
publicbindParam(
    string|int$param,
    mixed&$var,
    int$type = PDO::PARAM_STR,
    int$maxLength = 0,
    mixed$driverOptions = null
): bool
publicbindValue(string|int$param, mixed$value, int$type = PDO::PARAM_STR): bool
publiccloseCursor(): bool
publiccolumnCount(): int
publicerrorInfo(): array
publicexecute(?array$params = null): bool
publicfetch(int$mode = PDO::FETCH_DEFAULT, int$cursorOrientation = PDO::FETCH_ORI_NEXT, int$cursorOffset = 0): mixed
publicfetchAll(int$mode = PDO::FETCH_DEFAULT): array
publicfetchAll(int$mode = PDO::FETCH_COLUMN, int$column): array
publicfetchAll(int$mode = PDO::FETCH_CLASS, string$class, ?array$constructorArgs): array
publicfetchAll(int$mode = PDO::FETCH_FUNC, callable$callback): array
publicfetchColumn(int$column = 0): mixed
publicfetchObject(?string$class = "stdClass", array$constructorArgs = []): object|false
publicgetAttribute(int$name): mixed
publicgetColumnMeta(int$column): array|false
publicnextRowset(): bool
publicrowCount(): int
publicsetAttribute(int$attribute, mixed$value): bool
publicsetFetchMode(int$mode): bool
publicsetFetchMode(int$mode = PDO::FETCH_COLUMN, int$colno): bool
publicsetFetchMode(int$mode = PDO::FETCH_CLASS, string$class, ?array$constructorArgs = null): bool
publicsetFetchMode(int$mode = PDO::FETCH_INTO, object$object): bool
}

Properties

queryString

Used query string.

Changelog

VersionDescription
8.0.0PDOStatement implements IteratorAggregate now instead of Traversable.

Table of Contents

To Top