The database connection class provides basic query abstraction support and methods to easily execute SQL statements and query record sets, records or single values with an SQL query.
It establishes the connection to the database provider with PHP Data Objects (PDO) which technically allows using diverse database backends. Still the submitted queries must be formulated such that each DBMS to be used understands them.
UnbDatabase is a singleton class, there can only be one single instance of it during runtime. This way, the database connection can be used from multiple classes without passing its reference everywhere.
AddKeylistKey | Adds a new key to a key list. | |
Close | Closes the database connection. | |
Commit | Commits a transaction. | |
S | ConvertDateTime | Converts a date/time value between PHP's UNIX timestamps and the SQL notation. |
S | EscapeLikeWildcards | Escape a value to use the wildcards * and ? instead of SQL's % and _. |
Execute | Executes an SQL statement that returns no data. | |
GetDriverName | Gets the driver name used for the database connection. | |
S | GetInstance | Gets the instance of this class. |
GetRowsAffected | Gets the number of rows affected by the last SQL statement (only for DELETE, INSERT and UPDATE). | |
GetStatistics | Gets statistic data. | |
IsConstraintError | Gets a value indicating whether the last error condition describes a constraint violation. | |
IsOpen | Gets a value indicating whether the database connection is open. | |
Open | Opens a database connection. | |
Optimise | Optimises the database. | |
Prepare | Prepares an SQL statement. | |
Query | Executes an SQL statement and returns all records. | |
QueryArray | Executes an SQL statement and returns the first column of all records. | |
QueryRecord | Executes an SQL statement and returns the first record. | |
QueryValue | Executes an SQL statement and returns a single value. | |
RemoveKeylistKey | Removes a key from a key list. | |
ResetKeylistKeys | Removes all keys from a key list and set new keys. | |
RollBack | Rolls back a transaction. | |
StartTransaction | Starts a new transaction. |
Class constructor | Private constructor, does nothing but preventing an unwanted instantiation of this class. | |
DetermineErrorCondition | Finds out what the problem was. :-) | |
InternalExecute | Actually executes an SQL query. | |
ProcessSql | Basic SQL query processing. | |
ShowQueryInfo | Shows query information and errors. |
DisplayQueryErrors | true | Display queries and error messages when an error occurs. |
File: database.class.php, |
DisplayQueryInfo | false |
Display information for all issued queries. (Ineffective if DisplayQueryErrors is false .)
|
File: database.class.php, |
Implementation file: database.class.php, line 23
© 2010 Yves Goergen. UNB Components Homepage. Reference generated on 2010-03-07.