A MySQLDatabase class provides the tools to connect, query, etc., a MySQL database.
MySQL (at least as of 4.0.17) does not support nested transations. Begining a transaction after one is started will commit the previous transaction. This is pretty stupid behavior, so this class maintains a count of begin and commit calls and only runs the outer begin/commit/rollback statements. This allows applications coded for PostgreSQL/Oracle-style nested transactions to operate in MySQL.
Located in /harmoni/core/DBHandler/MySQL/MySQLDatabase.class.php (line 37)
DatabaseAbstract | --MySQLDatabase
The hostname of the database, i.e. myserver.mydomain.edu.
The hostname of the database, i.e. myserver.mydomain.edu.
The name of the default database to use.
The name of the default database to use.
The password for $_dbUser with which to connect to the database.
The password for $_dbUser with which to connect to the database.
The username with which to connect to the database.
The username with which to connect to the database.
The total number of failed queries executed since the last call to connect().
The total number of failed queries executed since the last call to connect().
Persistant connections can not be closed or have a new link forced, so this property is necessary for determining whether or not a mysql_select_db() is needed before queries to ensure that the proper database is selected.
Stores the current connection's link identifier.
If a connection is open, this stores the connection's identifier. Otherwise, it stores FALSE.
The total number of successful queries executed since the last call to connect().
The total number of failed queries executed since the last call to connect().
TRUE if this database supports transactions.
Creates a new database connection.
Commit a transaction. This will roll-back changes if errors occured in the transaction block.
Disconnects from the database.
Disconnects from the database.
Converts a database datetime/timestamp/time value (that has been fetched from the db) to a DateAndTime object.
Depending whether the value was fecthed from a datetime, date or timestamp column, $value could have the following two formats: 'YYYY-MM-DD HH:MM:SS' for datetime 'YYYY-MM-DD' for date For a timestamp, $value could be any of the following depending on the column size. TIMESTAMP(14) YYYYMMDDHHMMSS TIMESTAMP(12) YYMMDDHHMMSS - NOT SUPPORTED TIMESTAMP(10) YYMMDDHHMM - NOT SUPPORTED TIMESTAMP(8) YYYYMMDD TIMESTAMP(6) YYMMDD - NOT SUPPORTED TIMESTAMP(4) YYMM - NOT SUPPORTED TIMESTAMP(2) YY - NOT SUPPORTED
From MySQL version 4.1, TIMESTAMP is returned as a string with the format 'YYYY-MM-DD HH:MM:SS' and different timestamp lengths are no longer supported.
WARNING: Due to the ambiguity of 2-digit years, timestamp formats that use 2-digit years are not supported.
Answer the string SQL for the query
Returns the total number of failed queries executed since the last call to connect().
Returns the total number of failed queries executed since the last call to connect().
Returns the total number of successful queries executed since the last call to connect().
Returns the total number of successful queries executed since the last call to connect().
Returns a short string name for this database type. Example: 'MySQL'
Returns a list of the tables that exist in the currently connected database.
Indicates whether there is an open connection to the database.
Indicates whether there is an open connection to the database.
Makes a persistent database connection.
Makes a persistent database connection.
Executes an SQL query.
Executes an SQL query. The method is passed a query object, which it converts to a SQL query string using the appropriate SQLGenerator object.
Roll-back a transaction manually instead of committing
This method selects the default database to use in queries.
Return TRUE if this database supports transactions.
Converts a DateAndTime object to a proper datetime/timestamp/time representation for this Database.
The easiest way to convert is to create an integer (or a string, choose which one you think is better, MySQL accepts both, but make sure to document) in the following format: YYYYMMDDHHMMSS. You can pass this to a MySQL datetime or timestamp column types and it gets parsed automatically by MySQL.
Executes an SQL query.
Executes an SQL query.
Inherited From DatabaseAbstract
DatabaseAbstract::getConnectionErrorInfo()
Documentation generated on Wed, 19 Sep 2007 10:25:10 -0400 by phpDocumentor 1.3.0RC3