PreparedStatement class

Framework\Database\PreparedStatement

Class PreparedStatement.

Defined in libraries/database/src/PreparedStatement.php

Properties #

$statement
-
$sendingBlob
-

$statement

protected mysqli_stmt $statement

$sendingBlob

protected bool $sendingBlob = false

Methods #

__construct()
-
exec()
Executes the prepared statement and return the number of affected rows.
query()
Executes the prepared statement, returning a result set as a Result object.
sendBlob()
-
bindParams()
-

__construct()

public function __construct(mysqli_stmt $statement)
Parameters
  • mysqli_stmt $statement

exec()

public function exec(string|int|float|bool|null ...$params): string|int

Executes the prepared statement and return the number of affected rows.

Parameters
  • string|int|float|bool|null $params
Returns string|int

query()

public function query(string|int|float|bool|null ...$params): \Framework\Database\Result

Executes the prepared statement, returning a result set as a Result object.

Parameters
  • string|int|float|bool|null $params
Returns \Framework\Database\Result
throws
RuntimeException if it cannot obtain a result set from the prepared statement

sendBlob()

public function sendBlob(string $chunk): bool
Parameters
  • string $chunk
Returns bool

bindParams()

protected function bindParams(array $params): void
Parameters
  • array $params - Values types: bool, float, int, string or null
Returns void