DB class for MYSQL, POSTGRES, SQLITE, PHPLIB, ODBC
If you believe that database abstraction is a good think, but you don't want to
join the religous fights about the best one out there, then we have a common
interest.
This abstract wrapper class provides easy and simple class methods to access the
most important db function. It implements the functionality for databases like
MYSQL, POSTGRESQL or SQLITE. It provides a wrapper for PEAR, PHPLIB, ADOdb and
METABASE and enables you to switch between these db abstraction layers with only
changing a single line of code. You gain the possibility to develop similar code
for more than 15 different databases.
Detailed documentation for all the complete interface exists.
A ligtweight interface supports the most common tasks in an easy and efficent
way, such as sending queries and fetching result sets or single variables.
Additional classes provide tools for accessing database data, dumping
information in html tables, exporting db content to CSV-files or as SQL
statements or presenting database content pagewise (e.g. for search results).
/////////////////////////////////////////////////////////////
// Interface of version 1.0:
function Constructor($libraryPath, $dbType, $preferredResType = ASSOCIATIVE_ARRAY)
function connect($host, $db, $user, $password)
function disconnect()
function query($query)
function getNext($resultType = PREDEFINED_VALUE)
function getAll($resultType = PREDEFINED_VALUE)
function getValue()
function getColumn($resultType = PREDEFINED_VALUE)
function execute($query, $resultType = PREDEFINED_VALUE)
function free()
function numRows()
function affectedRows()
function getIdentifier()
function getTables()
function escapeStr()
This class can be used to display data from MySQL database query results in an HTML table. It can:
- Retrieve data to display executing simple or joined SQL queries
- Can display column values as links
- Can replace field values of any column
- Can have options for searching text values
- Supports column sorting and results pagination
- Can have a link column to a page for editing records
- Can delete database table rows
- Can export results in the CSV format