R
R
Ruslan Kuzmichev2015-10-29 09:11:38
PHP
Ruslan Kuzmichev, 2015-10-29 09:11:38

How to implement the action "Mark all (uncheck)" in a large list with pagination in PHP + MySQL?

Good afternoon. There is a need to work with a list of subscribers, lists can reach several thousand and tens of thousands of lines (less often, but they can). Naturally, to display such a volume immediately in the browser, to put it mildly, is unreasonable. Therefore, it is logical to use pagination.
The catch is that the user needs to be able to select everyone in the list or remove everyone from the list, but not just mark everyone, and then walk through the list and throw out or add someone at will. I would like to find the simplest solution to this problem. So far, I can only see the path in the forehead, write the id of the subscribers to the js-array and send it to the server, but the array may not turn out to be small at all.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Arman, 2015-10-29
@Arik

To make an array optional through JS, it's much easier through
Then by submitting the form you will get an array of the id's that were selected.
Of course, you send all this using the POST method, and there is enough to work out the list of IDs from one page that a person could read. Well, we give MySQL IN('. implode(', ', $deleteIds) .')
But to select all or cancel, you already use JS, there you just find all the checkboxes and indicate checked

R
Ruslan Kuzmichev, 2015-10-29
@Ruslan_K

with optimization it is clear, ahead of time it makes no sense to deal with it.
Now this solution works, but I thought maybe there is another way.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question