-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpagination.php
66 lines (57 loc) · 1.74 KB
/
pagination.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<?php
if(isset($_GET['page']))
{
$page = $_GET['page'];
}
else
{
$page = 1;
}
$num_per_page = 5;
$start_from = ($page - 1)*$num_per_page;
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<?php include_once('bootstrap.php');
include_once('./db_connect.php');
?>
<title>pagination</title>
</head>
<body>
<div class=" container mx-auto table table-striped w-100">
<table>
<th>
<td>Name</td>
<td> i_id </td>
<td> i_path</td>
<td>seller</td>
</th>
<?php
$query = "SELECT * FROM `images` LIMIT $start_from,$num_per_page";
$queryfire = mysqli_query($con,$query);
$num = mysqli_num_rows($queryfire);
$totle_page = ceil( $num / 3 );
while($result = mysqli_fetch_assoc($queryfire))
{
$name = $result['i_name'];
$id = $result['i_id'];
$path = $result['i_path'];
$seller = $result['s_username'];
?>
<tr>
<td><?php echo $name ?></td>
<td><?php echo $id ?> </td>
<td><?php echo $path ?></td>
<td><?php echo $seller ?></td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>