PdoCrudStatement
Class provides simple CRUD operations
Table of Contents
- $pdoStatement : PDOStatement
- PDO statement
- bindParameter() : void
- Method binds parameters to query
- execSelect() : array<string|int, mixed>
- Method executes select query and fetches results
- execute() : void
- Method executes SQL query
- executeSelect() : array<string|int, object>
- Method executes select query and fetches results
- prepare() : void
- Method sets safe query
- rowCount() : int
- Method returns count of affected rows
Properties
$pdoStatement
PDO statement
private
PDOStatement
$pdoStatement
= null
Methods
bindParameter()
Method binds parameters to query
public
bindParameter(string $parameter, mixed $variable[, int $type = PDO::PARAM_STR ]) : void
Parameters
- $parameter : string
-
name of the parameter
- $variable : mixed
-
value
- $type : int = PDO::PARAM_STR
-
parameter type
Tags
Return values
void —execSelect()
Method executes select query and fetches results
public
execSelect([array<string|int, mixed>|null $data = null ]) : array<string|int, mixed>
Parameters
- $data : array<string|int, mixed>|null = null
-
query data
Tags
Return values
array<string|int, mixed> —query result as an array of objects
execute()
Method executes SQL query
public
execute([array<string|int, mixed>|null $data = null ]) : void
Parameters
- $data : array<string|int, mixed>|null = null
-
query data
Tags
Return values
void —executeSelect()
Method executes select query and fetches results
public
executeSelect([array<string|int, mixed>|null $data = null ]) : array<string|int, object>
Parameters
- $data : array<string|int, mixed>|null = null
-
query data
Tags
Return values
array<string|int, object> —query result as an array of objects
prepare()
Method sets safe query
public
prepare(string $query) : void
Parameters
- $query : string
-
safe query
Tags
Return values
void —rowCount()
Method returns count of affected rows
public
rowCount() : int
Tags
Return values
int —count of affected rows