-
Notifications
You must be signed in to change notification settings - Fork 0
/
Update_Into_Database.php
60 lines (60 loc) · 1.54 KB
/
Update_Into_Database.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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Update Into Database</title>
<link rel="stylesheet" href="">
</head>
<style type="text/css">
.Success, caption {
color: rgb(158, 27, 214);
font-family: Bitter,Georgia,"Times New Roman",Times,serif;
font-size: 1.4em;
font-weight:bold;
}
</style>
<body>
<h2 class="Success"><?php echo @$_GET['Updated']; ?></h2>
<table width="1000" border="5" align="center">
<caption>View From Database</caption>
<tr>
<th>ID</th>
<th>Employee Name</th>
<th>SSN</th>
<th>Department</th>
<th>Salary</th>
<th>Home Address</th>
<th>Delete</th>
<th>Update</th>
</tr>
<?php
// Ket noi
$Connection = mysqli_connect("localhost", "root", "", "record");
// Truy van
$ViewQuery = "Select * From emp_record";
$Execute = mysqli_query($Connection, $ViewQuery);
while ($DataRows = mysqli_fetch_array($Execute)) { // Duyet qua tung phan tu,
$Id = $DataRows['id']; // gan cot trong csdl vao ten bien
$Ename = $DataRows['enam'];
$SSN = $DataRows['ssn'];
$Dept = $DataRows['dept'];
$Salary = $DataRows['salary'];
$HomeAddress = $DataRows['homeaddress'];
?>
<tr>
<td><?php echo $Id; ?></td>
<td><?php echo $Ename; ?></td>
<td><?php echo $SSN; ?></td>
<td><?php echo $Dept; ?></td>
<td><?php echo $Salary; ?></td>
<td><?php echo $HomeAddress; ?></td>
<td>Delete</td>
<td><a href="Update.php?Update=<?php echo $Id; ?>">Update</a></td>
</tr>
<?php
}
?>
</table>
</body>
</html>