PDOStatement クラス

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

はじめに

プリペアドステートメントを表します。ステートメント実行後は関連する結果セットを表します。

クラス概要

class PDOStatement implements IteratorAggregate {
/* プロパティ */
/* メソッド */
public function bindColumn(
    string|int $column,
    mixed &$var,
    int $type = PDO::PARAM_STR,
    int $maxLength = 0,
    mixed $driverOptions = null
): bool
public function bindParam(
    string|int $param,
    mixed &$var,
    int $type = PDO::PARAM_STR,
    int $maxLength = 0,
    mixed $driverOptions = null
): bool
public function bindValue(string|int $param, mixed $value, int $type = PDO::PARAM_STR): bool
public function closeCursor(): bool
public function columnCount(): int
public function debugDumpParams(): ?bool
public function errorCode(): ?string
public function errorInfo(): array
public function execute(?array $params = null): bool
public function fetch(int $mode = PDO::FETCH_DEFAULT, int $cursorOrientation = PDO::FETCH_ORI_NEXT, int $cursorOffset = 0): mixed
public function fetchAll(int $mode = PDO::FETCH_DEFAULT): array
public function fetchAll(int $mode = PDO::FETCH_COLUMN, int $column): array
public function fetchAll(int $mode = PDO::FETCH_CLASS, string $class, ?array $constructorArgs): array
public function fetchAll(int $mode = PDO::FETCH_FUNC, callable $callback): array
public function fetchColumn(int $column = 0): mixed
public function fetchObject(?string $class = "stdClass", array $constructorArgs = []): object|false
public function getAttribute(int $name): mixed
public function getColumnMeta(int $column): array|false
public function getIterator(): Iterator
public function nextRowset(): bool
public function rowCount(): int
public function setAttribute(int $attribute, mixed $value): bool
public function setFetchMode(int $mode): bool
public function setFetchMode(int $mode = PDO::FETCH_COLUMN, int $colno): bool
public function setFetchMode(int $mode = PDO::FETCH_CLASS, string $class, ?array $constructorArgs = null): bool
public function setFetchMode(int $mode = PDO::FETCH_INTO, object $object): bool
}

プロパティ

queryString

使ったクエリ文字列。

変更履歴

バージョン 説明
8.0.0 PDOStatement は、 Traversable ではなく、 IteratorAggregate を実装するようになりました。

目次