Posted by Toby A Inkster on 05/22/07 08:04
java.inet wrote:
> how to fetch the last five records in mysql through php
Don't. Modify your SQL to only select the last five records.
SELECT x.*
FROM (SELECT *
FROM table
ORDER BY sortorder DESC
LIMIT 5) x
ORDER BY x.sortorder
--
Toby A Inkster BSc (Hons) ARCS
http://tobyinkster.co.uk/
Geek of ~ HTML/SQL/Perl/PHP/Python/Apache/Linux
Navigation:
[Reply to this message]
|