Nextcloud PHP API (master)

IPreparedStatement

This interface allows you to prepare a database query.

This interface must not be implemented in your application but instead obtained from IDBConnection::prepare.

$prepare = $this->db->prepare($query->getSql());
Tags
since
21.0.0

Table of Contents

Methods

bindParam()  : bool
bindValue()  : bool
closeCursor()  : true
execute()  : IResult
fetch()  : mixed
fetchAll()  : array<string|int, mixed>
fetchColumn()  : mixed
fetchOne()  : mixed
rowCount()  : int

Methods

bindParam()

public bindParam(int|string $param, mixed &$variable[, int $type = ParameterType::STRING ][, int|null $length = null ]) : bool
Parameters
$param : int|string
$variable : mixed
$type : int = ParameterType::STRING
$length : int|null = null
Tags
throws
Exception
since
21.0.0
Return values
bool

bindValue()

public bindValue(int|string $param, mixed $value[, int $type = ParameterType::STRING ]) : bool
Parameters
$param : int|string
$value : mixed
$type : int = ParameterType::STRING
Tags
throws
Exception
since
21.0.0
Return values
bool

closeCursor()

public closeCursor() : true

use \OCP\DB\IResult::closeCursor on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Tags
since
21.0.0
Return values
true

execute()

public execute([array<string|int, mixed>|null $params = null ]) : IResult
Parameters
$params : array<string|int, mixed>|null = null
Tags
since
21.0.0
throws
Exception
Return values
IResult

fetch()

public fetch([int $fetchMode = PDO::FETCH_ASSOC ]) : mixed

use \OCP\DB\IResult::fetch on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Parameters
$fetchMode : int = PDO::FETCH_ASSOC
Tags
since
21.0.0

fetchAll()

public fetchAll([int $fetchMode = PDO::FETCH_ASSOC ]) : array<string|int, mixed>

use \OCP\DB\IResult::fetchAll on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Parameters
$fetchMode : int = PDO::FETCH_ASSOC
Tags
since
21.0.0
Return values
array<string|int, mixed>

fetchColumn()

public fetchColumn() : mixed

use \OCP\DB\IResult::fetchColumn on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Tags
since
21.0.0

fetchOne()

public fetchOne() : mixed

use \OCP\DB\IResult::fetchOne on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Tags
since
21.0.0

rowCount()

public rowCount() : int

use \OCP\DB\IResult::rowCount on the \OCP\DB\IResult returned by \OCP\IDBConnection::prepare

Tags
since
21.0.0
throws
Exception
Return values
int

        
On this page

Search results