#18634 [Opn->Bgs]: Pear DB query w/ sql's MAX() Returns wrong array handles
| From: | cox@php.net | Date: | Thu, 01 Aug 2002 15:48:43 +0000 |
| Subject: | #18634 [Opn->Bgs]: Pear DB query w/ sql's MAX() Returns wrong array handles | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-8130@lists.php.net to get a copy of this message | ||
ID: 18634
Updated by: cox@php.net
Reported By: starr@evilemail.com
-Status: Open
+Status: Bogus
Bug Type: PEAR related
Operating System: NT 4
PHP Version: 4.2.2
New Comment:
Use proper SQL column aliases instead ("SELECT min() as min..").
Tomas V.V.Cox
Previous Comments:
------------------------------------------------------------------------
[2002-07-30 00:34:28] starr@evilemail.com
...Pear DB / Mysql / $db is a pear db object
Using a mysql query w/ MIN() --- i.e. the following
$sql = "SELECT MIN(time) from mytable";
$time = $db->getAll( $sql, DB_FETCHMODE_ASSOC );
Returns a value in
$time[0]['MIN(time)'];
NOT in
$time[0]['time'];
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=18634&edit=1