\naigc\v25\utilMysql

Functions related to database queries.

Summary

Methods
Properties
Constants
__construct()
execute()
query()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

__construct()

__construct(\mysqli  $db) : mixed

Creates a new Mysql object.

Parameters

\mysqli $db

The database.

Returns

mixed

execute()

execute(string  $sql, callable|null  $bind = null) : \naigc\v25\util\IMysql

Executes an INSERT/UPDATE/DELETE query.

Parameters

string $sql

The query to run.

callable|null $bind

A function that binds the SQL parameters. Must declare $stmt as the only parameter.

Throws

\naigc\v25\exception\FailedMysqliPrepare
\naigc\v25\exception\FailedMysqliExecute

Returns

\naigc\v25\util\IMysql —

The Mysql object.

query()

query(string  $sql, callable|null  $bind = null, callable|null  $useResults = null) : \naigc\v25\util\IMysql

Executes a SELECT query.

Parameters

string $sql

The query to run.

callable|null $bind

A function that binds the SQL parameters. Must declare $stmt as the first of two parameters.

callable|null $useResults

A function to be called for every row returned by the query. Must declare $row as the second of two parameters.

Throws

\naigc\v25\exception\FailedMysqliPrepare
\naigc\v25\exception\FailedMysqliExecute

Returns

\naigc\v25\util\IMysql —

The Mysql object.