PHP and MySQL

C

Colin Roosendaal

Hello,

Can someone tell me how to do the following:

I'm looking for the PHP/MySQL query to get the last 5 added records from my
database/table.

For your info

DB name: news
table name: messages

I hope you can help me.

Thanks,

Colin Roosendaal
 
J

JDS

I'm looking for the PHP/MySQL query to get the last 5 added records from
my database/table.

It depends on how "last five records" is defined.

Is there a date field in the database?
Is there a numeric, auto-incremented ID field?

In other words, is there any field which can be used to track what field
was most recently added?

Is "most recently added" the ones you want? Or do you just want the bottom
five rows after a particular ORDER BY clause has been applied?

Also, this is *really* not an HTML question. Try alt.php or alt.php.sql
or comp.lang.php or other closer-to-on-topic group for more help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top