Usually you need to group on something for a max to work (at least in Oracle)

-----Original Message-----
From: "Hutchins, Richard" <[EMAIL PROTECTED]>
Sent: Jul 13, 2004 8:40 AM
To: [EMAIL PROTECTED]
Subject: RE: [PHP-DB] Getting a result from MAX() query

Sadly, I don't have any answers, only more questions.

First, how do you know your query is returning a FALSE result? What test are
you performing and what are the results of the test?

Second, what type of column is fee_recd?

I've been toying with the MAX() function on the command line with a number
of my own tables using different column types (DATE, TEXT, VARCHAR, INT) and
have yet to see it fail to return some sort of result set.

Rich


> -----Original Message-----
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 13, 2004 8:57 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-DB] Getting a result from MAX() query
> 
> 
> Would somebody be kind enough to explain why this query 
> produces a false result
> 
> $latest=mysql_query("SELECT MAX(fee_recd) FROM 
> members",$connectup)or die
> ("Query failed:<br>$latest<br>Error: " . mysql_error());
> 
> but this one doesn't
> 
> $latest=mysql_query("SELECT fee_recd FROM members ORDER BY 
> fee_recd DESC
> LIMIT 1",$connectup)or die ("Query failed:<br>$latest<br>Error: " .
> mysql_error());
> 
> Louise
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



---------------------------------------------------------------------------------------------
Dylan Barber                              :  AOL Messenger - dylanbarb
(CIW Professional, A+ Technician): MSN Messenger - [EMAIL PROTECTED]
Web Designer / Developer / Host
---------------------------------------------------------------------------------------------


Clip those URLs! - Short links are easier to remember.
http://clipurl.com

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to