How to limit the number of news displayed on the page

began to create your first site. But faced with such a problem: you need to somehow limit the number of news on one page. News from the database using ORDER BY.

Answer 1, Authority 100%

Hi. Change the database request by adding Limit:

SELECT * FROM `news` ORDER BY `name` LIMIT 0, 10

Limit is called with two parameters – from which entry start, and how much to output.
Try it.

Leave a reply

Please enter your comment!
Please enter your name here