class DDLStatement extends Statement

The class JsonSQLStatement Represents a prepared statement and, after the statement is executed, an associated result set.

Properties

protected JsonSQL $jsonsql from Statement
protected object $request from Statement
protected array $result from Statement
protected int $rowCount from Statement
protected array $params from Statement
protected Engine $engine from Statement

Methods

__construct(JsonSQL $jsonsql, stdClass $request)

Class Constructor

create(JsonSQL $jsonsql, stdClass $request)

Statement factory

from Statement
bool
bindValue(mixed $parameter, mixed $value, int $type = \PDO::PARAM_STR)

Binds a value to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.

from Statement
bool
bindParam(mixed $parameter, mixed $variable, int $type = \PDO::PARAM_STR)

Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.

from Statement
bool
execute(array $parameters = array())

Executes a prepared statement.

from Statement
int
rowCount()

Returns the number of rows affected by the last SQL statement

from Statement
int
columnCount()

Returns the number of columns in the result set

from Statement
void
checkValue(string $value, int $type = \PDO::PARAM_STR)

Checks if a value corresponds to its type and if it is safety in case of string

from Statement
bool
executeCompoundSelect()

function executeCompoundSelect

bool
executeSelect()

function executeSelect

bool
executeInsert()

function executeInsert

bool
executeUpdate()

function executeUpdate

bool
executeDelete()

function executeDelete

bool
executeCreateTable()

Executes a prepared 'create table' statement.

bool
executeAlterTable()

Executes a prepared 'alter table' statement.

bool
executeTruncate()

function executeTruncate

bool
executeDropTable()

Executes a prepared 'drop table' statement.

Details

at line 44
__construct(JsonSQL $jsonsql, stdClass $request)

Class Constructor

Parameters

JsonSQL $jsonsql The JsonSQL instance
stdClass $request The prepared statement

in Statement at line 109
create(JsonSQL $jsonsql, stdClass $request)

Statement factory

Parameters

JsonSQL $jsonsql The JsonSQL instance
stdClass $request &$request The prepared statement

in Statement at line 138
bool bindValue(mixed $parameter, mixed $value, int $type = \PDO::PARAM_STR)

Binds a value to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.

Parameters

mixed $parameter The parameter identifier
mixed $value The value to bind to the parameter
int $type The data type for the parameter using the PDO::PARAM_* constants.

Return Value

bool true on success or false on failure.

in Statement at line 189
bool bindParam(mixed $parameter, mixed $variable, int $type = \PDO::PARAM_STR)

Binds a PHP variable to a corresponding named or question mark placeholder in the SQL statement that was used to prepare the statement.

the variable is bound as a reference and will only be evaluated at the time that execute() is called.

Parameters

mixed $parameter The parameter identifier
mixed $variable &$variable The variable to bind to the parameter
int $type The data type for the parameter using the PDO::PARAM_* constants.

Return Value

bool true on success or false on failure.

in Statement at line 202
bool execute(array $parameters = array())

Executes a prepared statement.

Parameters

array $parameters An array of values with as many elements as there are bound parameters in the SQL statement being executed. All values are treated as PDO::PARAM_STR.

Return Value

bool true on success or false on failure.

in Statement at line 242
int rowCount()

Returns the number of rows affected by the last SQL statement

Return Value

int The number of rows.

in Statement at line 253
int columnCount()

Returns the number of columns in the result set

Return Value

int The number of columns in the result set. If there is no result set, returns 0.

in Statement at line 266
protected void checkValue(string $value, int $type = \PDO::PARAM_STR)

Checks if a value corresponds to its type and if it is safety in case of string

Parameters

string $value The value
int $type The expected type

Return Value

void

Exceptions

JsonSQLException

at line 191
protected bool executeCompoundSelect()

function executeCompoundSelect

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 203
protected bool executeSelect()

function executeSelect

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 215
protected bool executeInsert()

function executeInsert

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 227
protected bool executeUpdate()

function executeUpdate

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 239
protected bool executeDelete()

function executeDelete

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 54
protected bool executeCreateTable()

Executes a prepared 'create table' statement.

Return Value

bool TRUE.

at line 92
protected bool executeAlterTable()

Executes a prepared 'alter table' statement.

Return Value

bool TRUE.

at line 251
protected bool executeTruncate()

function executeTruncate

Return Value

bool Always true.

Exceptions

JsonSQLException

at line 175
protected bool executeDropTable()

Executes a prepared 'drop table' statement.

Return Value

bool TRUE.