class Mysql implements IDatabase

MySql Database Class

Properties

protected bool $_isConnected Database connection state
protected Mysqli $_db MySql Database object
static protected Mysql $_instance Database Singleton
Mysql $mysqlResult Mysql Result
string $host Can be either a host name or an IP address.
string $user The MySQL user name.
string $password If not provided or NULL, the MySQL server will attempt to authenticate the user against those user records which have no password only.
string $name If provided will specify the default database to be used when performing queries.

Methods

static Mysql
getInstance()

Singleton

__wakeup()

No description

connect(array $options = null)

(non-PHPdoc)

__destruct()

Destruct

close()

(non-PHPdoc)

boolean
autocommit(boolean $mode)

Turns on or off auto-committing database modifications

mixed
tquery(string $query)

Performs a query on the database

boolean
commit()

Commits the current transaction

boolean
rollback()

Rolls back current transaction

mysqli_stmt|boolean
prepare()

Prepare an SQL statement for execution

mysqli
DB()

Returns the mysqli object

query($query, array $options = null, $isTransaction = false)

(non-PHPdoc)

multitype:array
_fetch(string $query, string $return = "assoc")

Fetch

number|boolean
_exec(string $query)

Mysql Update or Delete

number|boolean
_insert(string $query)

Sqlite Insert

bool
isConnected()

(non-PHPdoc)

setOptions(array $options = null)

Set Options

string
escapeString($query)

(non-PHPdoc)

insertRow(object $obj, string $table, array $ignores = null)

Insert Row

updateRow(object $obj, string $table, string|array $key, string|array $value, array $ignores = null)

Update Row

deleteRow(object $obj, string $table, string|array $key, string|array $value)

Delete Row

deleteInsertRow(object $obj, string $table, string|array $key, string|array $value, array $ignores = null)

Delete Insert Row

setCharset(string $encoding = 'utf8')

Name Set Support

setNames(string $encoding = 'utf8')

Character Set Support

Details

at line 95
static Mysql getInstance()

Singleton

Return Value

Mysql

at line 104
__wakeup()

at line 114
connect(array $options = null)

(non-PHPdoc)

Parameters

array $options

See also

\jtl\Connector\Core\Database\IDatabase::connect()

at line 135
__destruct()

Destruct

at line 147
close()

(non-PHPdoc)

See also

\jtl\Connector\Core\Database\IDatabase::close()

at line 158
boolean autocommit(boolean $mode)

Turns on or off auto-committing database modifications

Parameters

boolean $mode

Return Value

boolean

at line 169
mixed tquery(string $query)

Performs a query on the database

Parameters

string $query

Return Value

mixed

at line 179
boolean commit()

Commits the current transaction

Return Value

boolean

at line 189
boolean rollback()

Rolls back current transaction

Return Value

boolean

at line 199
mysqli_stmt|boolean prepare()

Prepare an SQL statement for execution

Return Value

mysqli_stmt|boolean

at line 209
mysqli DB()

Returns the mysqli object

Return Value

mysqli

at line 219
query($query, array $options = null, $isTransaction = false)

(non-PHPdoc)

Parameters

$query
array $options
$isTransaction

See also

\jtl\Connector\Core\Database\IDatabase::query()

at line 284
protected multitype:array _fetch(string $query, string $return = "assoc")

Fetch

Parameters

string $query
string $return

Return Value

multitype:array |NULL

at line 318
protected number|boolean _exec(string $query)

Mysql Update or Delete

Parameters

string $query

Return Value

number|boolean

Exceptions

DatabaseException

at line 338
protected number|boolean _insert(string $query)

Sqlite Insert

Parameters

string $query

Return Value

number|boolean

Exceptions

DatabaseException

at line 356
bool isConnected()

(non-PHPdoc)

Return Value

bool $this->_isConnected

See also

\jtl\Connector\Core\Database\IDatabase::isConnected()

at line 366
setOptions(array $options = null)

Set Options

Parameters

array $options

at line 396
string escapeString($query)

(non-PHPdoc)

Parameters

$query

Return Value

string

See also

\jtl\Connector\Core\Database\IDatabase::escapeString()

at line 409
Mysql insertRow(object $obj, string $table, array $ignores = null)

Insert Row

Parameters

object $obj
string $table
array $ignores

Return Value

Mysql

at line 472
Mysql updateRow(object $obj, string $table, string|array $key, string|array $value, array $ignores = null)

Update Row

Parameters

object $obj
string $table
string|array $key
string|array $value
array $ignores

Return Value

Mysql

at line 560
Mysql deleteRow(object $obj, string $table, string|array $key, string|array $value)

Delete Row

Parameters

object $obj
string $table
string|array $key
string|array $value

Return Value

Mysql

at line 621
Mysql deleteInsertRow(object $obj, string $table, string|array $key, string|array $value, array $ignores = null)

Delete Insert Row

Parameters

object $obj
string $table
string|array $key
string|array $value
array $ignores

Return Value

Mysql

at line 635
setCharset(string $encoding = 'utf8')

Name Set Support

Parameters

string $encoding

at line 645
setNames(string $encoding = 'utf8')

Character Set Support

Parameters

string $encoding