PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » Database » MDB_QueryTool » Bug #3925

"Undefined offset" Error!

Details

Submitted2005-03-23 03:42 UTC
Frommvolkov at eol dot ca
Assignedquipo
StatusClosed
PackageMDB_QueryTool
PHP Version4.3.10
OSLinux
Roadmaps(Not assigned)

Comments

[2005-03-23 03:42 UTC] mvolkov at eol dot ca

Description:
------------
The example provided with code gives an error:
----------------------------------------------------------
1 - $user->get(3)
In /usr/local/lib/php/MDB/QueryTool/Query.php, line: 1945

Undefined offset: 1
------------------------------------------------------------

# Portion in "example.php" wich gave an error.
// get a single entry with a given 'id'
headline('$user->get(3)');
$user->reset(); // reset the query-builder, so no where, order, etc. are set
$res = $user->get(3);
myPrint($res);
// query: SELECT * FROM user WHERE id=3

Reproduce code:
---------------
Since the The lines 1944, 1945 in Query.php

SHOULD READ:
------------------------------------------------------------
$limit = isset($query['limit']) ? $query['limit'] : $this->_limit;
if (!$isCalledViaGetCount && @$limit) { // is there a count set?

AND NOT:
------------------------------------------------------------
$limit = isset($query['limit']) ? $query['limit'] : $this->_limit;
if (!$isCalledViaGetCount && @$limit[1]) { // is there a count set?