C
C
Carlyndow Marlifi2021-05-11 15:26:26
PHP
Carlyndow Marlifi, 2021-05-11 15:26:26

How to take second 10 values ​​from db?

Hello. I have never worked with pages in PHP.
I want to make 5 pages and place 10 elements on each.

#php code...

#здесь я беру первые 10 страниц
$first_page= acc("SELECT * FROM `list` ORDER BY `id` DESC LIMIT 10");
#теперь вопрос, как мне взять вторые 10 страниц, третьи, и тд?


Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Denis Yuriev, 2021-05-11
@petushok55

$first_page= acc("SELECT * FROM `list` ORDER BY `id` DESC LIMIT 10 OFFSET 10");

Everything is in the documentation
https://dev.mysql.com/doc/refman/8.0/en/select.html
[LIMIT {[offset,] row_count | row_count OFFSET offset}]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question