view.php 1.69 KB
Newer Older
Ajayguru Madu's avatar
Ajayguru Madu committed
1
<?php
rama chandra's avatar
rama chandra committed
2

Ajayguru Madu's avatar
Ajayguru Madu committed
3
4
require('db.php');
include("auth.php");
rama chandra's avatar
rama chandra committed
5
6

$query = "SELECT * from bloo "; 
rama chandra's avatar
rama chandra committed
7
8
$result = mysqli_query($con, $query) or die ( mysqli_error());
$row = mysqli_fetch_assoc($result);
Ajayguru Madu's avatar
Ajayguru Madu committed
9
10
11
12
13
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
rama chandra's avatar
rama chandra committed
14
<title>Update Record</title>
Ajayguru Madu's avatar
Ajayguru Madu committed
15
16
17
18
<link rel="stylesheet" href="css/style.css" />
</head>
<body>
<div class="form">
rama chandra's avatar
rama chandra committed
19
20
21
22
<p><a href="index.php">Home</a> | <a href="insert.php">Insert New Record</a> | <a href="logout.php">Logout</a></p>
<h2>View Records</h2>
<table width="100%" border="1" style="border-collapse:collapse;">
<thead>
rama chandra's avatar
updated    
rama chandra committed
23
<tr><th><strong>S.No</strong></th><th><strong>Name</strong></th><th><strong>Blood Group</strong></th><th><strong>Age</strong></th><th><strong>Last donated before months</strong></th><th><strong>Mobile No</strong></th><th><strong>City</strong></th><th><strong>Last donated</strong></th><th><strong>Edit</strong></th><th><strong>Delete</strong></th></tr>
rama chandra's avatar
rama chandra committed
24
25
</thead>
<tbody>
Ajayguru Madu's avatar
Ajayguru Madu committed
26
<?php
rama chandra's avatar
rama chandra committed
27
28
29
30
$count=1;
$sel_query="Select * from bloo ORDER BY id desc;";
$result = mysqli_query($con,$sel_query);
while($row = mysqli_fetch_assoc($result)) { ?>
rama chandra's avatar
updated    
rama chandra committed
31
<tr><td align="center"><?php echo $count; ?></td><td align="center"><?php echo $row["uname"]; ?></td><td align="center"><?php echo $row["blood"]; ?></td><td align="center"><?php echo $row["age"]; ?></td><td align="center"><?php echo $row["dd"]; ?></td><td align="center"><?php echo $row["mobile"]; ?></td><td align="center"><?php echo $row["city"]; ?></td><td align="center"><?php echo $row["ldonated"]; ?></td><td align="center"><a href="edit.php?id=<?php echo $row["id"]; ?>">Edit</a></td><td align="center"><a href="delete.php?id=<?php echo $row["id"]; ?>">Delete</a></td></tr>
rama chandra's avatar
rama chandra committed
32
33
34
<?php $count++; } ?>
</tbody>
</table>
rama chandra's avatar
rama chandra committed
35

Ajayguru Madu's avatar
Ajayguru Madu committed
36
37
38
</div>
</body>
</html>