[Solved] Displaying the top record Only?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shab620
Forum Commoner
Posts: 48
Joined: Tue Jan 18, 2005 7:50 pm

[Solved] Displaying the top record Only?

Post by shab620 »

Hye

I have a table which has a series of values within it. The table has an identifier which is numeric vaue and set to autoincrement when an order is added.

What i want to do is simply display the top (newest record) when i perfrom a query to retive the results

I've tried "MAX(Special_ID)" and this displays the top record but just the Special_ID column

Does anyone know how I might do this?

:)

Shab
Last edited by shab620 on Mon Feb 28, 2005 9:46 am, edited 1 time in total.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Code: Select all

SELECT * FROM table ORDER BY `Special_ID` DESC LIMIT 1
shab620
Forum Commoner
Posts: 48
Joined: Tue Jan 18, 2005 7:50 pm

Post by shab620 »

Thanks for that Feyd

That is working now.

Shab
:D :D
Post Reply