how to display last 20 record in php?
can u show me the mysql query?
Display last 20 record
Moderator: General Moderators
Depends on the database and the table schema but basically, it's something like this:
Code: Select all
SELECT * FROM table ORDER BY id DESC LIMIT 20You mean ?
No. MySQL uses LIMIT instead of this and can also be used to point out a starting row
Select 20 rows.
Select 20 rows, starting at row 10.
There are some other special cases interesting to know about, and a good start to find info is here.
Code: Select all
select TOP 20 from table ...No. MySQL uses LIMIT instead of this and can also be used to point out a starting row
Select 20 rows.
Code: Select all
select * from table LIMIT 20Code: Select all
select * from table LIMIT 10, 20