AloFramework documentation
  • Namespace
  • Class
  • Tree
  • Deprecated
  • Todo
  • Download

Namespaces

  • Alo
    • Cache
    • CLI
    • Controller
    • Db
    • Exception
    • FileSystem
    • Session
    • Statics
    • Test
    • Validators
    • Windows
  • Controller
  • None
  • PHP

Classes

  • AbstractDb
  • MySQL

Class MySQL

MySQL database manager

Alo\Db\AbstractDb
Extended by Alo\Db\MySQL
Namespace: Alo\Db
Author: Art <a.molcanovas@gmail.com>
Author: Art <a.molcanovas@gmail.com>
Located at sys/class/alo/db/mysql.php

Methods summary

public
# __construct( string $ip = ALO_MYSQL_SERVER, integer $port = ALO_MYSQL_PORT, string $user = ALO_MYSQL_USER, string $pw = ALO_MYSQL_PW, string $db = ALO_MYSQL_DATABASE, string $cache = ALO_MYSQL_CACHE, array $options = null )

Instantiates the database connection

Instantiates the database connection

Parameters

$ip
string
$ip The IP address to use
$port
integer
$port The port to use
$user
string
$user The username
$pw
string
$pw The password
$db
string
$db The database to use
$cache
string
$cache Which cache interface to use
$options
array
$options Connection options

Author

Art <a.molcanovas@gmail.com>

Overrides

Alo\Db\AbstractDb::__construct
public static Alo\Db\MySQL
# MySQL( string $ip = ALO_MYSQL_SERVER, integer $port = ALO_MYSQL_PORT, string $user = ALO_MYSQL_USER, string $pw = ALO_MYSQL_PW, string $db = ALO_MYSQL_DATABASE, string $cache = ALO_MYSQL_CACHE, array $options = null )

Instantiates the database connection

Instantiates the database connection

Parameters

$ip
string
$ip The IP address to use
$port
integer
$port The port to use
$user
string
$user The username
$pw
string
$pw The password
$db
string
$db The database to use
$cache
string
$cache Which cache interface to use
$options
array
$options Connection options

Returns

Alo\Db\MySQL

Author

Art <a.molcanovas@gmail.com>
public integer|float
# aggregate( string $sql, array $params = null, array $settings = [] )

Returns an aggregated one-column result set, e.g. from a count(*) query

Returns an aggregated one-column result set, e.g. from a count(*) query

Parameters

$sql
string
$sql The SQL code
$params
array
$params Bound parameters
$settings
array
$settings Optional settings

Returns

integer|float

Author

Art <a.molcanovas@gmail.com>
public array|boolean
# prepQuery( string $sql, array $params = null, array $settings = [] )

Executes a prepared query and returns the results

Executes a prepared query and returns the results

Parameters

$sql
string
$sql The SQL code
$params
array
$params Bound parameters
$settings
array
$settings Optional settings

Returns

array|boolean
Result array on SELECT queries, TRUE/FALSE for others

Author

Art <a.molcanovas@gmail.com>
public Alo\Db\MySQL
# beginTransaction( )

Begins a transaction

Begins a transaction

Returns

Alo\Db\MySQL

Author

Art <a.molcanovas@gmail.com>
public Alo\Db\MySQL
# commit( )

Commits a transaction

Commits a transaction

Returns

Alo\Db\MySQL

Author

Art <a.molcanovas@gmail.com>
public PDOStatement
# prepare( string $sql )

Prepares a statement

Prepares a statement

Parameters

$sql
string
$sql A SQL statement to prepare

Returns

PDOStatement

Author

Art <a.molcanovas@gmail.com>
public array|boolean
# query( string $sql )

Executes a quick unescaped query without preparing it

Executes a quick unescaped query without preparing it

Parameters

$sql
string
$sql SQL code

Returns

array|boolean
Result array on SELECT queries, TRUE/FALSE for others

Author

Art <a.molcanovas@gmail.com>
public Alo\Db\MySQL
# rollBack( )

Rolls back a transaction

Rolls back a transaction

Returns

Alo\Db\MySQL

Author

Art <a.molcanovas@gmail.com>
public boolean
# transactionActive( )

Checks whether a transaction is active

Checks whether a transaction is active

Returns

boolean

Author

Art <a.molcanovas@gmail.com>
public mixed
# __call( string $name, array $arguments )

Handles direct calls to PDO

Handles direct calls to PDO

Parameters

$name
string
$name Method name
$arguments
array
$arguments Array of parameters

Returns

mixed

Author

Art <a.molcanovas@gmail.com>

Methods inherited from Alo\Db\AbstractDb

getLastHash(), hash()

Magic methods summary

Constants summary

Constants inherited from Alo\Db\AbstractDb

V_CACHE, V_FETCH_NUM, V_PREFIX, V_TIME

Properties summary

protected PDO $pdo
#

The PDO instance

The PDO instance

Properties inherited from Alo\Db\AbstractDb

$cache, $cache_prefix, $default_settings, $last_hash

AloFramework documentation API documentation generated by ApiGen 2.8.0