I don\'t have direct access to database from PHP. if it was so, I could have done pagination simply. Here I send a GET request to a PHP web service, and the result from the
You have several options available, the 'best' two I would suggest are the following:
PHP solution:
use sessions, (aka put session_start();
before every php file that will need access to session variables, also add a script to cause the session to timeout)
Store the DB output to a session variable, if the session variable is not set.
if (!isset($_SESSION['tabledata'])) {
$json_data_fromdb= httpGet($ur3l."fromtable?u=".$var1."&ip=".$var2);
$array = json_decode($json_data_fromdb, true);
$_SESSION['count']=count($array['qqq']);
$_SESSION['tabledata'] = $array['qqq'];
}
Then, you can simply paginate through the data, by sending a request for a certain range of values.
Alternatively, you can use a javascript solution like Datatables And either load all the information and let datatables filter it, or let datatables communicate with the other PHP server directly.