G
G
GSmaster2016-03-29 14:56:24
PHP
GSmaster, 2016-03-29 14:56:24

How to find out on which page any of the records is located?

I make a selection from the database - 16 random records. As a result, I have an array with unique records.
And now the question is - how to find out on which page any of the records is located, if during the normal viewing of all records, pagination of 5 records per page?
This is to make a link with an anchor - site.ru/page/10/#id

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dimonchik, 2016-03-29
@dimonchik2013

well, apply the pagination algorithm
numOnPage = N
PageNum = 1 + int(TotalNum) / int(numOnPage)

G
GSmaster, 2016-03-29
@GSmaster

I'm sorry - but what is N here?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question