AW: [PHP-DB] I can't seem to get Max() to work
| From: | Lars Hilsebein | Date: | Thu, 28 Oct 2004 13:12:35 +0000 |
| Subject: | AW: [PHP-DB] I can't seem to get Max() to work | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-37066@lists.php.net to get a copy of this message | ||
How about the following statement (Not the best way, but it could solve your
problem):
$sql = "SELECT FoodItemNumber FROM menuitemsubs ORDER BY FoodItemNumber DESC
LIMIT 1"
-----Ursprüngliche Nachricht-----
Von: Bastien Koert [mailto:bastien_k@hotmail.com]
Gesendet: Donnerstag, 28. Oktober 2004 15:00
An: cjp@planetoxygene.com; php-db@lists.php.net
Betreff: RE: [PHP-DB] I can't seem to get Max() to work
is it an iteger type datafield?
bastien
>From: "Chris Payne" <cjp@planetoxygene.com>
>To: <php-db@lists.php.net>
>Subject: [PHP-DB] I can't seem to get Max() to work
>Date: Thu, 28 Oct 2004 01:05:46 -0400
>
>Hi there everyone,
>
>
>
>I can't seem to get the below to work with PHP and MySQL:
>
>
>
>$sql = "SELECT MAX(FoodItemNumber) FROM menuitemsubs";
>
>
>
>What am I doing wrong? I need the highest number from the column
>FoodItemNumber, but it doesn't return anything unless I change the MAX() to
>a * and I don't want that I need it to be the MAX() number as it isn't an
>auto-increment field.
>
>
>
>Chris
>
>
>---
>Outgoing mail is certified Virus Free.
>Checked by AVG anti-virus system (http://www.grisoft.com).
>Version: 6.0.783 / Virus Database: 529 - Release Date: 10/25/2004
>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php