...

View Full Version : Displaying only the latest 2 rows of a table



Figurine
07-29-2008, 07:30 PM
Hi there!

My problem:
I can't exactly figure out how to display only the 2 newest rows of a table. I am using a mysql database and everything works as it should.
It works fine to do the SELECT * FROM...but what if I only what the latest two rows to be displayed?

I am working on a news column that should have an extract on the front page which is where I stop as I cannot seem to get this to work.

Any ideas?

best,
Figurine

djm0219
07-29-2008, 07:45 PM
Add
ORDER BY `your field name here` DESC LIMIT 2 to your SQL call.

Figurine
07-30-2008, 09:00 AM
Yay!

Thanks so much!
Best,
Figurine



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum