-
Notifications
You must be signed in to change notification settings - Fork 0
/
display.php
95 lines (85 loc) · 2.18 KB
/
display.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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
<?php
include 'connect.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>CRUD Operation</title>
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-Zenh87qX5JnK2Jl0vWa8Ck2rdkQ2Bzep5IDxbcnCeuOxjzrPF/et3URy9Bv1WTRi" crossorigin="anonymous">
</head>
<body>
<div class="container">
<a href="user.php" >
<button class="btn btn-primary my-5">Add User</button>
</a>
<table class="table">
<thead>
<tr>
<th scope="col">SI No</th>
<th scope="col">Name</th>
<th scope="col">Mobile</th>
<th scope="col">Email</th>
<th scope="col">Password</th>
<th scope="col">Operations</th>
</tr>
</thead>
<tbody>
<?php
$sql="select * from `crud`";
$result=mysqli_query($con,$sql);//Procedural style
if($result){
//$row=mysqli_fetch_assoc($result);
while($row=mysqli_fetch_assoc($result)){
$id=$row['id'];
$name=$row['name'];
$mobile=$row['mobile'];
$email=$row['email'];
$password=$row['password'];
echo '
<tr>
<th scope="row">'.$id.'</th>
<td>'.$name.'</td>
<td>'.$mobile.'</td>
<td>'.$email.'</td>
<td>'.$password.'</td>
<td>
<button class="btn btn-secondary">
<a class="text-light" href="update.php?updateid='.$id.'">update</a>
</button>
<button class="btn btn-danger">
<a class="text-light" href="delete.php?deleteid='.$id.'">delete</a>
</button>
</td>
</tr>';
}
}
?>
</tbody>
</table>
<!--
<tr>
<th scope="row">1</th>
<td>Mark</td>
<td>Otto</td>
<td>@mdo</td>
</tr>
<tr>
<th scope="row">2</th>
<td>Jacob</td>
<td>Thornton</td>
<td>@fat</td>
</tr>
<tr>
<th scope="row">3</th>
<td colspan="2">Larry the Bird</td>
<td>@twitter</td>
</tr>
</tbody>
</table>
-->
</div>
</body>
</html>