RE: [PHP-DB] Getting a result from MAX() query
| From: | Hutchins, Richard | Date: | Tue, 13 Jul 2004 13:40:06 +0000 |
| Subject: | RE: [PHP-DB] Getting a result from MAX() query | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-35212@lists.php.net to get a copy of this message | ||
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: boclair@boclair.com [mailto:boclair@boclair.com]
> Sent: Tuesday, July 13, 2004 8:57 AM
> To: php-db@lists.php.net
> 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
>
>