-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.php
More file actions
23 lines (21 loc) · 705 Bytes
/
Copy pathscript.php
File metadata and controls
23 lines (21 loc) · 705 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<?php
$mysqli = new mysqli('localhost:3306','vikram','Parjapat@123','coder');
if($mysqli->connect_errno !=0)
{
echo $mysqli->connect_error;
exit();
}
$start = 0;
// Setting the number of rows to display in a page
$rows_per_page = 9;
$records = $mysqli->query("SELECT * FROM `jobcap` 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 `jobcap` ORDER BY `id` DESC LIMIT $start,$rows_per_page");