$start = 0;
// Setting the number of rows to display in a page
$rows_per_page = 9;
$records = $mysqli->query("SELECT * FROM `indexjob` ORDER BY `id` DESC");
$nr_of_rows = $records->num_rows;
// calculating of nr of pages
$pages = ceil($nr_of_rows / $rows_per_page);
// if the user clicks on the pagination buttons we set a new starting point.
if(isset($_GET['page-nr']))
{
$page = $_GET['page-nr']-1;
$start = $page * $rows_per_page;
}
$result = $mysqli->query("SELECT * FROM `indexjob` ORDER BY `id` DESC LIMIT $start,$rows_per_page");
I am using Simple HTML DOM and PHP code to retrieve a list in ascending order on the webpage.
my code is working fine for the descending order but when I try to do it in ascending order it retrieves the same as in descending order.
I am trying to fix it by myself but I haven’t found a good solution