Page 1 of 1

last row in database?

Posted: Wed Dec 04, 2002 9:36 pm
by volrathxp
I have a question.

I am currently in the process of starting a webcomics site. i'm having a bit of trouble however, i am not as familiar with php as i'd like to be but i do understand some of the mysql stuff for it.

basically i need to know how i can create a page that will interact with the database i have set up for the comics to display the comics and allow the user to browse, but the "latest comic" link always takes the user back to the newest comic. i really do not understand how i'm gonna do this, so if someone could please help i'd appreciate it so much.

thanks!

Posted: Wed Dec 04, 2002 9:48 pm
by volka
if you have an auto-increment field in your table (e.g. called id) you might use a query like

Code: Select all

SELECT * from tblName ORDER BY id DESC LIMIT 1
(today is ORDER BY/LIMIT-day ;) )