大网数据广告活动
PHP 语言与运行手册

The SQLite3Stmt class

· 52CE 我爱测

A class that handles prepared statements for the SQLite 3 extension. Instances are obtained from SQLite3::prepare(). Calling SQLite3Stmt::execute() runs the query and returns a SQLite3Result for result sets.

The SQLite3Stmt class

(PHP 5 >= 5.3.0, PHP 7, PHP 8)

Introduction

A class that handles prepared statements for the SQLite 3 extension. Instances are obtained from SQLite3::prepare(). Calling SQLite3Stmt::execute() runs the query and returns a SQLite3Result for result sets.

Class synopsis

class SQLite3Stmt {
/* Constants */
public const int EXPLAIN_MODE_PREPARED = 0;
public const int EXPLAIN_MODE_EXPLAIN = 1;
/* Methods */
private function __construct(SQLite3 $sqlite3, string $query)
public function bindParam(string|int $param, mixed &$var, int $type = SQLITE3_TEXT): bool
public function bindValue(string|int $param, mixed $value, int $type = SQLITE3_TEXT): bool
public function busy(): bool
public function clear(): bool
public function close(): true
public function execute(): SQLite3Result|false
public function explain(): int
public function getSQL(bool $expand = false): string|false
public function paramCount(): int
public function readOnly(): bool
public function reset(): bool
public function setExplain(int $mode): bool
}

Predefined Constants

SQLite3Stmt::EXPLAIN_MODE_PREPARED

The statement operates in normal prepared statement mode (no EXPLAIN). Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.

SQLite3Stmt::EXPLAIN_MODE_EXPLAIN

The statement operates as if prefixed with EXPLAIN, returning opcode information from the virtual machine. Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.

SQLite3Stmt::EXPLAIN_MODE_EXPLAIN_QUERY_PLAN

The statement operates as if prefixed with EXPLAIN QUERY PLAN, returning high-level query plan information. Available as of PHP 8.5.0, when compiled against libsqlite >= 3.43.0.

Table of Contents

来源:PHP Documentation Group · 作者与贡献记录 · CC BY 3.0。离线整理了版式、链接和媒体显示。

资料来源与适用范围

资料来源
PHP Documentation Group
适用范围
请按文中版本与环境说明核对
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。