PHP Class Pop\Db\Adapter\Mysql

Author: Nick Sagona, III ([email protected])
Inheritance: extends AbstractAdapter
显示文件 Open project: nicksagona/PopPHP

Public Methods

Method Description
__construct ( array $options ) : Mysql Constructor
disconnect ( ) : void Close the DB connection.
escape ( string $value ) : string Return the escaped string value.
execute ( string $sql ) : void Execute the prepared SQL query.
fetch ( ) : array Return the results array from the results resource.
lastId ( ) : integer Return the auto-increment ID of the last query.
numFields ( ) : integer Return the number of fields in the result.
numRows ( ) : integer Return the number of rows in the result.
query ( string $sql ) : void Execute the SQL query and create a result resource, or display the SQL error.
showError ( ) : void Throw an exception upon a database error.
version ( ) : string Return the database version.

Protected Methods

Method Description
loadTables ( ) : array Get an array of the tables of the database.

Method Details

__construct() public method

Instantiate the Mysql database connection object.
public __construct ( array $options ) : Mysql
$options array
return Mysql

disconnect() public method

Close the DB connection.
public disconnect ( ) : void
return void

escape() public method

Return the escaped string value.
public escape ( string $value ) : string
$value string
return string

execute() public method

Execute the prepared SQL query.
public execute ( string $sql ) : void
$sql string
return void

fetch() public method

Return the results array from the results resource.
public fetch ( ) : array
return array

lastId() public method

Return the auto-increment ID of the last query.
public lastId ( ) : integer
return integer

loadTables() protected method

Get an array of the tables of the database.
protected loadTables ( ) : array
return array

numFields() public method

Return the number of fields in the result.
public numFields ( ) : integer
return integer

numRows() public method

Return the number of rows in the result.
public numRows ( ) : integer
return integer

query() public method

Execute the SQL query and create a result resource, or display the SQL error.
public query ( string $sql ) : void
$sql string
return void

showError() public method

Throw an exception upon a database error.
public showError ( ) : void
return void

version() public method

Return the database version.
public version ( ) : string
return string