I'm using PHP & MySQL to create a simple guestbook. I've created my
table and I'm able to load my information in as usual. I would like it
to display the latest entry first though. I set an id to each entry
that is auto-incremented. The idea seems real easy in theory:
1. Create a loop that starts at the last entry and goes until it
finishes the first.
2. Each time around display the entire entry.
My question is, how do I find the last entry if I don't know what it
is? For example, right now I have three entries and I can display them
starting with the first. I know there are three so I set my counter to
start at 0 and end on 2 (0,1,2) now if I want to reverse it and start
with the last, how do I get the last id?
Any help would be appreciated.
--
Cheers,
Jim
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
table and I'm able to load my information in as usual. I would like it
to display the latest entry first though. I set an id to each entry
that is auto-incremented. The idea seems real easy in theory:
1. Create a loop that starts at the last entry and goes until it
finishes the first.
2. Each time around display the entire entry.
My question is, how do I find the last entry if I don't know what it
is? For example, right now I have three entries and I can display them
starting with the first. I know there are three so I set my counter to
start at 0 and end on 2 (0,1,2) now if I want to reverse it and start
with the last, how do I get the last id?
Any help would be appreciated.
--
Cheers,
Jim
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
Comment