Home » Database » MDB_QueryTool
An OO-interface for easily retrieving and modifying data in a DB.
This package is unmaintained.
Download latest release 1.2.3 (archived versions might be outdated)
License: BSD
Description
This package is an OO-abstraction to the SQL-Query language, it provides methods such
as setWhere, setOrder, setGroup, setJoin, etc. to easily build queries.
It also provides an easy to learn interface that interacts nicely with HTML-forms using
arrays that contain the column data, that shall be updated/added in a DB.
This package bases on an SQL-Builder which lets you easily build
SQL-Statements and execute them.
NB: this is a PEAR::MDB porting from the original DB_QueryTool
written by Wolfram Kriesing and Paolo Panto (vision:produktion, wk@visionp.de).
Documentation
Maintainers
- Lorenzo Alberton (quipo) — lead, active
- Elmar Pitschke (hugoki) — contributor, active
Dependencies
Required
- PHP (>= 4.1)
- PEAR Installer (>= 1.4.0b1)
- Log (>= 1.7)
Optional
Releases
- 1.2.3 (stable, 2012-04-11)
Release notes
License: BSD
QA release
- fixed bug #12905: add() doesn't return the id of the inserted
row when using MDB2 and no primaryCol
- fixed bug #13307: wrong fieldname case with oracle
- fixed bug #13308: do not rely on autoload (PHP4 fix)
- fixed bug #13694: quoting identifiers is not working with CAST()
- fixed bug 14160: INSERT Fails with MDB2 under certain circumstances
- fixed bug #14862: Call to undefined method MDB_Error::tableinfo() [doconnor]
- Bug #13388 ->add with mdb2 and mysql v5.0
- Bug #14863 Fatal error: Call to a member function quoteIdentifier() on a non-object
- #14943 setSelet or addSelect incorrectly quotes function expression
- Bug #19217 get unit tests working
- Bug #19218 _localeSafeImplode() broken for NULL / empty strings - 1.2.2 (stable, 2008-01-12)
Release notes
License: BSD
- fixed identifier quoting with functions in _buildSelect()
- better identifier quoting in _buildFrom()
- Coding Standards fixes - 1.2.1 (stable, 2008-01-12)
Release notes
License: BSD
- fixed bug #9963: Quoting problem with COUNT(*)
- fixed bug #10073: bug with empty() and 0 in _localeSafeImplode()
- fixed bug #10890: warning with addMultiple() when no PRIMARY KEY is set
- Coding Standards fixes - 1.2.0 (stable, 2007-01-27)
Release notes
License: BSD
- added getOne() method (request #7580)
- custom implementation of implode() to circumvent locale handling of floats,
which clashes with SQL standards (thanks to Lukas Ruetz)
- fixed bug #7909: different names for nextId()/nextID() in MDB and MDB2
- request #8056: add support for NULL fields in remove()
- fixed bug #8319: add $options['idxname_format'] to connect() to bypass
MDB2 default index format
- added save() method to MDB_QueryTool_Result_Row (Elmar)
- fixed handling of returned values in MDB_QueryTool_Result
- added getFirst(), getNext() and hasMore() methods to MDB_QueryTool_Result_Object
- added support for custom return classes (Elmar)
- added table and field name quoting (requests #4613, #5250, #7570, #9197) (Elmar)
- fixed bug #9734, an incorrect regexp adds extraneous table names to the fields,
if the name of the field appears as a column name in the current table.
- added new tests
- switched to package.xml v2 - 1.1.1 (stable, 2006-05-01)
Release notes
License: BSD
- fixed MDB_QueryTool_Result_Object::fetchRow() when the return type is
a scalar value instead of an array (bug #7532) - 1.1.0 (stable, 2006-04-08)
Release notes
License: BSD
- added MDB2 support. Just set $MDBversion = 2 as the third parameter
of the constructor, and QueryTool will use MDB2 as the backend instead
of MDB (thanks to Lukas Smith). - 1.0.2 (stable, 2006-01-26)
Release notes
License: BSD
- changed license to BSD
- fixed bug with big integers being incorrectly trimmed - 1.0.1 (stable, 2005-09-08)
Release notes
License: PHP
- added support for INNER JOINs (req #3842)
- fixed bug #3842, using the addJoin/setJoin methods causes an "invalid token"
error with ibase; the joined table columns aliases are now named in this
format: "t_tablename_fieldname" instead of "_tablename_fieldname".
Only the ibase driver is affected by this change.
- fixed notice (bug #3925)
- fixed pass-by-reference error with PHP 5.1 (thanks to Dmitry Shirokov)
- added new tests - 1.0.0 (stable, 2005-03-03)
Release notes
License: PHP
- fixed bug #3290, getCount() method returns zero when using an offset
(patch by kubo at isite dot co dot jp)
- fixed bug #3518, Error in _quote when you use raw option = true
- strings lenghtier than the column max size are truncated
to prevent db errors
- using setOrder() with setGroup()+setHaving() could cause a malformed query
- fully tested with MySQL, PostgreSQL and Firebird/Interbase
(added a new testsuite using SimpleTest) - 0.11.1 (stable, 2004-10-18)
Release notes
License: PHP
- allow multiple left|right join clauses.
NB: getJoin($type) now returns
array(
$joinTable1 => $joinOnClause1,
$joinTable2 => $joinOnClause2,
)
- allow class usage without instanciating a db object
(to use the class as a simple query builder)
- unset non-specific PEAR::DB options before calling connect()
(bug #1614)
- allow reuse of existing connection (bug #2007),
thanks to eln at gmx dot net - 0.10.1 (stable, 2004-05-05)
Release notes
License: PHP
- changed useResult() method; now it accepts a $type parameter, use it to
return 'array' results or 'object' results (thanks to Roman Dostovalov).
Please note that BC is maintained, useResult(true) will default to
useResult('array'), and useResult(false) will default to useResult('none').
- fixed problems with useResult(true) and empty results
- when using useResult(true), if the user doesn't call getFirst() on the first
iteration, the class does so automatically - 0.9.7 (stable, 2004-03-19)
Release notes
License: PHP
- on UPDATE, field names are no more prefixed by the table name
- added an $options parameter to connect()
- fix bug #284 (Log::factory() needs to return a reference)
- fix bug #298 (reset() does not reset limit)
- fix bug #322 (undefined var $autoConnect)
- PHP 5 fixes
- fixes to the testsuite - 0.9.6 (stable, 2003-09-23)
Release notes
License: PHP
- added new method getQueryString() which returns the rendered query
- added setDbInstance() which lets you supply an existing MDB-instance to work with
using this you dont need to pass a DSN to the constructor!
- use Log 1.7 API
- addWhereSearch now only prefixes known columns as it is supposed to be
- make setLimit also work to unset it - 0.9.5 (stable, 2003-06-17)
Release notes
License: PHP
- bugfix when writing log files, times were wrong
- bugfix in EasyJoin, which added unnecessary conditions
- bugfix in building column alias which is at the end of the string
- bugfix in addMultiple() which didnt work without primaryCol
- bugfix in addHaving, thanks to Johannes Schaefer - 0.9.4 (stable, 2003-06-09)
Release notes
License: PHP
- added set/getLimit(), which set the limit globally, getAll() and getCol() can still overwrite this temporarily
- added addOrder()
- added *Having() methods by Johannes Schaefer
- fix bug in building group clause for getCount()
- bug fix in building join - 0.9.3 (beta, 2003-02-20)
Release notes
License: PHP
- fixed stupid connection bug (my bad :p)
- other minor fixes/updates - 0.9.2 (beta, 2003-02-10)
Release notes
License: PHP
- fixed missing custom sequence name handling
- enhancing the constructor to take the error/log callbacks - 0.9 (beta, 2003-01-28)
Release notes
License: PHP
- initial release in PEAR
Bugs
| ID | Status | Type | Version | Date | Summary |
|---|---|---|---|---|---|
| #322 | Closed | Bug | 2003-11-28 | Undefined var $autoConnect | |
| #520 | Bogus | Bug | 2004-01-05 | Fatal error: Call to undefined method mdb_error::tableinfo() in /usr/local/lib/ | |
| #768 | Closed | Bug | 2004-02-16 | query update failure(postgresql) | |
| #3485 | Closed | Bug | 2005-02-15 | metadata method that not work with 'optimize' option of MDB | |
| #3518 | Closed | Bug | 2005-02-18 | Error in _quote when you use raw option = true | |
| #3842 | Closed | Req | 2005-03-16 | Inner/outter join | |
| #3925 | Closed | Bug | 2005-03-22 | "Undefined offset" Error! | |
| #7415 | Closed | Bug | 1.1.0 | 2006-04-18 | Call to undefined method MDB_mysql::queryAssoc |
| #7532 | Closed | Bug | CVS | 2006-05-01 | Warning in the constructor MDB_QueryTool_Result_Row |
| #7570 | Closed | Bug | 1.1.1 | 2006-05-06 | Postgres SQL bug (case sensitive inserts) |
| #7642 | Open | Req | 2006-05-16 | Data type abstraction layer does not work not fetched results | |
| #7757 | Bogus | Bug | CVS | 2006-05-30 | _makeIndexed return NULL value when db col type is NOT NULL |
| #7909 | Closed | Bug | 1.1.1 | 2006-06-15 | nextID broken, prevents records from saving |
| #8056 | Closed | Req | 1.1.1 | 2006-06-28 | Add support to remove() for NULL comparisons |
| #8292 | No Feedback | Bug | 1.1.1 | 2006-07-26 | Joining tables where one table name occurs in another table name |
| #8319 | Closed | Bug | 1.1.1 | 2006-07-29 | * is stripped from $what when performing simple querys |
| #8398 | Closed | Bug | CVS | 2006-08-09 | wrong _buildSelect with * and mysqli driver |
| #9130 | Closed | Bug | 1.1.1 | 2006-10-21 | setOrder doubles name of table |
| #9734 | Closed | Bug | 1.1.1 | 2007-01-04 | problem with preg_replace statement in _buildGroup |
| #9872 | Wont fix | Req | 1.1.1 | 2007-01-18 | Feature Request - get SELECT as assoc array? |
| #9963 | Closed | Bug | 1.2.0 | 2007-01-29 | Quoting problem with COUNT(*) |
| #10073 | Closed | Bug | CVS | 2007-02-12 | Zero (0) bug with empty() in _localeSafeImplode() |
| #10160 | Closed | Bug | 1.2.0 | 2007-02-22 | raw mode still quotes with MDB2 |
| #10246 | Closed | Doc | 1.2.0 | 2007-03-02 | Consecutive calls to setWhere don't work |
| #10890 | Closed | Bug | 1.2.0 | 2007-04-29 | pgsql -> addMultiple cause Warning "Cannot use a scalar value as an array" |
| #12905 | Closed | Bug | 1.2.2 | 2008-01-14 | function add |
| #13307 | Closed | Bug | 1.2.2 | 2008-03-04 | Array reference error |
| #13308 | Closed | Bug | 1.2.2 | 2008-03-04 | Acess getBeforeID not is possible |
| #13388 | Closed | Bug | 1.2.2 | 2008-03-13 | ->add with mdb2 and mysql v5.0 |
| #13694 | Closed | Bug | 1.2.2 | 2008-04-16 | escaping is not working in some cases |
| #14160 | Closed | Bug | 1.2.2 | 2008-06-17 | INSERT Fails |
| #14542 | Open | Bug | 1.2.2 | 2008-08-22 | Problem with join if field is underscore separated |
| #14863 | Closed | Bug | 1.2.2 | 2008-10-25 | Fatal error: Call to a member function quoteIdentifier() on a non-object |
| #14943 | Closed | Bug | 1.2.2 | 2008-11-03 | setSelet or addSelect incorrectly quotes function expression |
| #15463 | Open | Bug | 1.2.2 | 2008-12-30 | Broken SELECT |
| #16029 | No Feedback | Req | 1.2.2 | 2009-03-12 | Handling Views |
| #16524 | Open | Bug | 1.2.2 | 2009-08-14 | Query.add() returns 'NULL' i.o inserted id for MDB2+autoincrement |
| #17290 | Open | Bug | 1.2.2 | 2010-04-04 | MySQL AUTO_INCREMENT problems |
| #19217 | Closed | Bug | SVN | 2012-01-11 | get unit tests working |
| #19218 | Closed | Bug | SVN | 2012-01-11 | _localeSafeImplode() broken for NULL / empty strings |