RE: [PHP] Right syntax for max value??
| From: | Jay Blanchard | Date: | Tue, 14 Jun 2005 16:10:03 +0000 |
| Subject: | RE: [PHP] Right syntax for max value?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-216949@lists.php.net to get a copy of this message | ||
[snip]
$getnewstitle = "SELECT newstitle FROM
news WHERE news_id = ( SELECT
max( news_id ) FROM news ) ";
Does anybody know the right syntax?
[/snip]
Yes, people on the MySQL list.
Actually you do not need the sub-select here (your remote host may not
have a MySQL version that supports sub-queries)....
$getnewstitle = "SELECT MAX(news_id), newstitle FROM news ";