-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshowdata.php
33 lines (33 loc) · 887 Bytes
/
showdata.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
<?php
require_once 'conn.php';
$sql = "SELECT * FROM trys";
$result = $db->query($sql);
$i = 0;
while ($data = $result->fetch_array()) {
$i++;
if ($data > 0){
$id = $data['id'];
$name = $data['name'];
$email = $data['email'];
$number = $data['number'];
echo "<tr>
<td> $i </td>
<td> $name </td>
<td> $email </td>
<td> $number </td>
<td class='d-flex'>
<a class='mr-2 btn btn-primary' href='edit.php?id= $id '>Update</a>
<form action='delete.php' method='POST'>
<input type='hidden' name='id' value=" . $id . ">
<button type='submit' class='btn btn-danger mr-2'>Delete</button>
</form>
</td>
</tr>";
}
else{
echo "<tr>
<td colspan='5' class='text-center'>No Data Found</td>
</tr>";
}
}
?>