DB_OP Class Reference
A wrapper class of normally used PostgreSQL operations.
More...
List of all members.
Detailed Description
This class is used to construct database connection to a PostgreSQL database. It also includes some basic operation to database. This can be a template for future development of connecting to other databases
Constructor & Destructor Documentation
DB_OP::__construct |
( |
$ |
params |
) |
|
Constructor. Accepts one parameter containing the database connection settings.
- Parameters:
-
Member Function Documentation
DB_OP::initialize |
( |
|
) |
[private] |
Initialize Database Settings. Called by the constructor.
- Parameters:
-
- Returns:
- boolean. TRUE for successful initialisation. FALSE otherwise.
DB_OP::_connect_string |
( |
|
) |
[private] |
Construct connection string
- Returns:
- string
DB_OP::db_connect |
( |
|
) |
[private] |
Non-persistent database connection
- Returns:
- resource
DB_OP::db_pconnect |
( |
|
) |
[private] |
Persistent database connection
- Returns:
- resource
Reconnect
Keep / reestablish the db connection if no queries have been sent for a length of time exceeding the server's idle timeout
- Returns:
- void
Affected Rows
- Returns:
- integer
DB_OP::select |
( |
$ |
table, |
|
|
$ |
select = array('*') | |
|
) |
| | |
Generates the SELECT portion of the query when multiple fileds are needed
- Parameters:
-
| $table | Type: string. |
| $select | Type: array. |
- Returns:
- string
DB_OP::simple_query |
( |
$ |
sql |
) |
|
Simple Query This function is used for client script will process result. Or running transaction commands since they do not require all the features of the main query() function.
- Parameters:
-
- Returns:
- resource
DB_OP::query |
( |
$ |
sql, |
|
|
$ |
return_object = FALSE | |
|
) |
| | |
Execute the query
Accepts an SQL string as input and returns a result object upon successful execution of a "read" type query. Returns boolean TRUE upon successful execution of a "write" type query. Returns boolean FALSE upon failure.
- Parameters:
-
| string | An SQL query string |
| array | An array of binding data |
- Returns:
- mixed
Load the result drivers
- Returns:
- string the name of the result class
Close database connection
- Returns:
- void
DB_OP::_error_message |
( |
|
) |
[private] |
The error message string
- Returns:
- string
DB_OP::display_error |
( |
$ |
error = '' , |
|
|
$ |
swap = '' , |
|
|
$ |
native = FALSE | |
|
) |
| | |
Display an error message in some format
- Parameters:
-
| string | the error message |
| string | any "swap" values |
| boolean | whether to localize the message |
- Returns:
- string sends the application/error_db.php template
The documentation for this class was generated from the following file: