This is my first post on these forums, so allow me to introduce myself. I'm new to PHP and MYSQL, having started using it only less than a year ago as a hobby. I'm not quite sure whether I should post this in the Newbies section or here, but it is a database specific problem.
Anyway, my problem is that I want to order MYSQL rows in descending order, seems simple enough, but the problem is, I want to order the latest 20 rows in descending order, and not all of them. The problem I have is when I go to do this, it displays the first 20 rows in descending order, and then just stays that way, never updating.
What I want to happen is new rows to appear at the bottom like so:
If I had a limit of 5 it would look like this:
Row 1
Row 2
Row 3
Row 4
Row 5
And stay that way, even if there were 6 rows in the table, when I want it to look like this:
Row 2
Row 3
Row 4
Row 5
Row 6
The query I'm using right now is
mysql_query("SELECT * FROM table_name ORDER BY id DESC LIMIT 20");