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
Tags
since
21.0.0
deprecated
21.0.0

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

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
Parameters
$fetchMode : int = PDO::FETCH_ASSOC
Tags
since
21.0.0
deprecated
21.0.0

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

fetchAll()

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

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

Return values
array<string|int, mixed>

fetchColumn()

public fetchColumn() : mixed
Tags
since
21.0.0
deprecated
21.0.0

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

fetchOne()

public fetchOne() : mixed
Tags
since
21.0.0
deprecated
21.0.0

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

rowCount()

public rowCount() : int
Tags
since
21.0.0
throws
Exception
deprecated
21.0.0

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

Return values
int

        
On this page

Search results