You are here: RE: [PHP] Right syntax for max value?? « PHP « IT news, forums, messages
RE: [PHP] Right syntax for max value??

Posted by "Neal Carmine" on 06/14/05 19:06

Mysql 3.23 does not support the subquery you are using in your sql
statement.

Check http://dev.mysql.com/doc/mysql/en/subqueries.html for more
information.

Neal

-----Original Message-----
From: twistednetadmin [mailto:twistednetadmin@gmail.com]
Sent: Tuesday, June 14, 2005 9:44 AM
To: php-general@lists.php.net
Subject: [PHP] Right syntax for max value??

I am making a table at my homepage that automatically collects the
latest news from mysql db.
I have got it to work at my own server at home, but not at
www.torewestre.com (my remote site)

Local settings:(WinXP Pro) Apache 2.0.54, PHP 5.0.4 and MySQL 4.1.11

Remote settings:(Unix) Apache 1.3.27, PHP 4.3.4 and MySQL 3.23.54

This is the query that works on localhost:


$getnewstitle = "SELECT newstitle FROM `news` WHERE news_id = ( SELECT
max( news_id ) FROM news ) ";

What it does:

collects the newstitle from the field where PRIMARY key(news_id) is
the highest auto_increment number.

This works just as excpected on localhost but not on remote.

Does anybody know the right syntax?

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация