Jump to content

Simple SQL question.


gaza165

Recommended Posts

i need to use an sql query to select the last 10 from my database but need it in ascending order.

 

 

$sql = "SELECT * FROM chat ORDER BY chat_id LIMIT 0,10";

 

i know this will select the records from 0,10 but in my db they are like this

 

id    MESSAGE

 

1    FIRST

2    SECOND

3      THIRD

4    Fifth

 

basically, the older the post i dont want it to be displayed. i want the most recent 10 records that are in the database.

 

sorry i havent explained clearly.

Link to comment
https://forums.phpfreaks.com/topic/138172-simple-sql-question/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.