php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18634 Pear DB query w/ sql's MAX() Returns wrong array handles
Submitted: 2002-07-30 00:34 UTC Modified: 2002-08-01 11:48 UTC
From: starr at evilemail dot com Assigned:
Status: Not a bug Package: PEAR related
PHP Version: 4.2.2 OS: NT 4
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: starr at evilemail dot com
New email:
PHP Version: OS:

 

 [2002-07-30 00:34 UTC] starr at evilemail dot 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'];

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-01 11:48 UTC] cox@php.net
Use proper SQL column aliases instead ("SELECT min() as min..").


Tomas V.V.Cox
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Apr 16 21:01:28 2024 UTC