Justtechjobs.com Find a programming school near you






Online Campus Both


php-db | 2004071

RE: [PHP-DB] Getting a result from MAX() query From: Dylan Barber (dylan.barber <email protected>)
Date: 07/13/04

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

-----Original Message-----
From: "Hutchins, Richard" <Richard.Hutchins <email protected>>
Sent: Jul 13, 2004 8:40 AM
To: php-db <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: boclair <email protected> [mailto:boclair <email protected>]
> Sent: Tuesday, July 13, 2004 8:57 AM
> To: php-db <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 - dylan.barber <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