View Single Post
10-13-2008, 12:11 PM
#6
shilpamg is offline shilpamg
Status: Member
Join date: Aug 2008
Location:
Expertise:
Software:
 
Posts: 101
iTrader: 0 / 0%
 

shilpamg is on a distinguished road

  Old

Originally Posted by Jako View Post
I've been just getting into PHP lately, so I'm not 100% sure on this, but this is what I use on one of my queries.

PHP Code:
$image_id "SELECT * FROM images ORDER BY i_id DESC LIMIT 1"
This is sorting my table by the i_id, newest one being on the top and I'm limiting the results to 1, which is the newest entry.

So for yours maybe try

PHP Code:
$queryRecent "SELECT name FROM table ORDER BY id DESC LIMIT 10"
this is the right query.