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
 
Ad

Advertisements

Ad

Advertisements

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.
 

Top