Jump to content

[SOLVED] MYSQL ORDER BY


Northern Flame

Recommended Posts

hello,

I am trying to order my data by the id,

but i only want to show the latest 5 that

were entered. I know how to only display

5, but it shows the first 5, not the last 5,

can anyone help?

 

        $limit = 5;
$query = "SELECT * FROM table ORDER BY id LIMIT $limit";
$result = mysql_query($query) or die("ERROR " . mysql_error());

Link to comment
https://forums.phpfreaks.com/topic/64150-solved-mysql-order-by/
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.