[PHP-WIN] Re: Stil having problems (WAS : Problem with links....)

2003-03-02 Thread Orlando CastaƱeda
Sorry, in my application, i have something similar ; my table "data" has an id (auto increment), name ,etc. What i need is to show the name of the most recently entered id. My Sql sintax is: "SELECT name FROM data WHERE id=MAX(id)" But i have an error displaing: "Invalid use of group function" an

[PHP-WIN] Re: Stil having problems (WAS : Problem with links....)

2003-02-28 Thread Neil Smith
Hi - check your SQL : I think what you have here is a select asking for MAX(ID) which will return one result (this is what MAX does). So, no need to ask for WHERE id IN (SELECT(MAX(ID)) but instead ask for SELECT id=MAX(ID). If you wanted top n instead, ask for SELECT id FROM data ORDER BY id D