php-db | 2004071
Date: 07/13/04
- Next message: Peter Westergaard: "Re: [PHP-DB] Table locking"
- Previous message: Doug Thompson: "Re: [PHP-DB] Getting a result from MAX() query"
- In reply to: boclair <email protected>: "[PHP-DB] Getting a result from MAX() query"
- Next in thread: boclair: "Re: [PHP-DB] Getting a result from MAX() query"
- Reply: boclair: "Re: [PHP-DB] Getting a result from MAX() query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
boclair <email protected> 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
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Peter Westergaard: "Re: [PHP-DB] Table locking"
- Previous message: Doug Thompson: "Re: [PHP-DB] Getting a result from MAX() query"
- In reply to: boclair <email protected>: "[PHP-DB] Getting a result from MAX() query"
- Next in thread: boclair: "Re: [PHP-DB] Getting a result from MAX() query"
- Reply: boclair: "Re: [PHP-DB] Getting a result from MAX() query"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

