Re: Getting a result from MAX() query
| From: | John W. Holmes | Date: | Tue, 13 Jul 2004 14:44:05 +0000 |
| Subject: | Re: Getting a result from MAX() query | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-35215@lists.php.net to get a copy of this message | ||
boclair@boclair.com wrote:
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());Would you be kind enough to tell us what text mysql_error() shows? You probably just need to use an alias in your query: SELECT MAX(fee_recd) AS max_fee_recd FROM members and then you'll have $row['max_fee_recd'] when you fetch the value from your result set. Other wise you need to use $row['MAX(fee_recd)']... -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.com