Class MOXMAN_Util_Pdo
Inheritance | MOXMAN_Util_Pdo » PDO |
---|
This class extends the PHP PDO class and adds table prefix support to all queries. It also provides some helper functions.
Public Methods
Method | Description | Defined By |
---|---|---|
__construct() | Constructs a new PDO intance. | MOXMAN_Util_Pdo |
exec() | Executes the specified query and returns a statement. | MOXMAN_Util_Pdo |
getDriverName() | Returns the name of the current driver. For example: mysql. | MOXMAN_Util_Pdo |
getSqliteFilePath() | Returns the Sqlite filepath. | MOXMAN_Util_Pdo |
i() | Executes the specified query and returns the first column as an integer. | MOXMAN_Util_Pdo |
prepare() | Creates a new prepared statment instance. | MOXMAN_Util_Pdo |
q() | Executes the specified query. | MOXMAN_Util_Pdo |
qrs() | Executes the specified query and returns and array with assoc arrays. | MOXMAN_Util_Pdo |
query() | Executes the specified query. | MOXMAN_Util_Pdo |
Method Details
Constructs a new PDO intance.
public void __construct ( $dsn, $user = null, $password = null, $driverOptions = [], $prefix = null ) | ||
$dsn | string | Connection string. |
$user | string | User to login to database with. |
$password | string | Password to login to database with. |
$driverOptions | Array | Various driver option. |
$prefix | string | Table prefix to use instead of the default one. |
Executes the specified query and returns a statement.
public PDOStatement exec ( $statement ) | ||
$statement | string | This is a description |
return | PDOStatement | Query statement. |
---|
Returns the name of the current driver. For example: mysql.
public String getDriverName ( ) | ||
return | String | Currently used driver name. |
---|
Returns the Sqlite filepath.
public String getSqliteFilePath ( ) | ||
return | String | Sqlfile path. |
---|
Executes the specified query and returns the first column as an integer.
public int i ( $statement ) | ||
$statement | string | Statement to execute. |
return | int | First column as an integer. |
---|
Creates a new prepared statment instance.
public void prepare ( $statement, $driverOptions = [] ) | ||
$statement | string | Statement to prepare. |
$driverOptions | Array | Array with driver options. |
Executes the specified query.
public PDOStatement q ( $statement ) | ||
$statement | string | This is a description |
return | PDOStatement | Query statement. |
---|
Executes the specified query and returns and array with assoc arrays.
public Array qrs ( $statement ) | ||
$statement | string | This is a description |
return | Array | Array of result items. |
---|
Executes the specified query.
public PDOStatement query ( $statement ) | ||
$statement | string | This is a description |
return | PDOStatement | Query statement. |
---|