|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
cDatabases
This is a wrapper class used to provide a common access interface for all the RDBMS specific classes. Use this classes methods to set and/or retrieve a database object. "Dummy" methods are provided which mirror the database operation methods in the access classes which provides a common interface to the operations without the need for long overload statements. The actual database operations are performed by using methods detailed in the cFrontBase(), cPostgreSQL(), cMSSQL, cODBC(), and cMYSQL classes.
| Field Summary | |
obj |
$current_db
This variable is used to store the internal object of the currently selected database. |
array |
$database_types
This variable is array of the objects created for the various databases suuported by this abstraction layer. |
| Constructor Summary | |
void |
cDatabases()
The class contructor checks to see whether FrontBase, MS SQL Server, ODBC, and mySQL support is enabled in PHP then creates, registers and stores objects for any of the above databases supported. |
| Method Summary | |
int |
ColumnLength(resource result, int column_offset)
Used to access the ColumnLength method of the currently set database object. |
string |
ColumnName(resource result, int column_offset)
Used to access the ColumnName method of the currently set database object.. |
string |
ColumnType(resource result, int column_offset)
Used to access the ColumnType method of the currently set database object.. |
void |
Connect(string hostname, string username, string password, string database)
Used to access the Connect method of the currently set database object.. |
void |
Disconnect()
Used to access the Disconnect method of the currently set database object.. |
array |
FetchRow(resource result [, int array_type])
Used to access the FetchRow method of the currently set database object.. |
void |
FreeResult(resource result)
Used to access the FreeResult method of the currently set database object.. |
obj |
Get(string database [, int set_internal_obj])
The get method is used to retrieve and return the object for the database you desire to use. |
string |
GetLastMessage()
Used to access the GetLastMessage method of the currently set database object.. |
boolean |
NextResult(resource result)
Used to access the NextResult method of the currently set database object. |
int |
NumRows(resource result)
Used to access the NumRows method of the currently set database object. |
int |
Query(string sql_query)
Used to access the Query method of the currently set database object. |
void |
Register(string database, obj database_object)
The Register method is called by the constructor during the class instantiation. |
void |
Set(string database)
The set method is used to set the select the database spefied by $type without returning an object variable. |
| Field Detail |
array $database_types
obj $current_db
| Constructor Detail |
void cDatabases()
| Method Detail |
string ColumnName(resource resource_id, int column_offset)
resource_id - the resource indentifer returned by Query()
column_offset - the number of the column who's name will returned
int ColumnLength(resource resource_id, int column_offset)
resource_id - the resource indentifer returned by Query()
column_offset - the number of the column who's field length will returned
string ColumnType(resource resource_id, int column_offset)
resource_id - the resource indentifer returned by Query()
column_offset - the number of the column who's datatype will returned
void Connect(string hostname, string username, string password, string database)
hostname - the name/address of the server to connect to
username - the username to use for the database connection
password - the password for the specified username
database - the name of the database to use [optional]
void Disconnect()
array FetchRow(resource resource_id [, int array_type])
resource_id - the resource indentifer returned by Query()
array_type - the type of array indexing to use1 => returns an array with associative indices
2 => returns an array with numerical indices (default)
3 => returns an array with both associative and numerical indices
void FreeResult(resource resource_id)
resource_id - the resource indentifer returned by Query()
obj Get (string database [, int set_internal_obj])
database - the database to select.
set_internal_obj - the flag which indicates whether to set the class's current db object var.
string GetLastMessage()
boolean NextResult(resource resource_id)
resource_id - the resource indentifer returned by Query()
int NumRows(resource resource_id)
resource_id - the resource indentifer returned by Query()
int Query(string sql_query)
sql_query - the SQL query to execute on the current data connection
void Register (string database, obj database_object)
database - the database to select.
database_object - the object returned from an instanciation of one of the db specific classes
void Set (string database)
database - the database to select.
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||