-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsave_edit.php
57 lines (39 loc) · 1.13 KB
/
save_edit.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
<?php
include('includes/connection.php');
foreach ($_POST as $key => $value) {
$$key = $value;
}
$sql = "update pelajar ";
$sql .= "set no_matriks = '$no_matriks',";
$sql .= "nama_penuh = '$nama_penuh',";
$sql .= "no_kp = '$no_kp',";
$sql .= "kursus = '$kursus'";
$sql .= " where pelajar_id = $pelajar_id";
mysqli_query($con, $sql );
$affected_rows = mysqli_affected_rows( $con );
//echo "<a href='list.php'>KEMBALI KE SENARAI</a><br/>";
?>
<!doctype>
<html>
<head>
<title>JOMWEB : CRUD Challenge</title>
<link rel="stylesheet" href="assets/normalize.css">
<link rel="stylesheet" href="assets/style.css">
<!--FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,700,300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css'>
</head>
<body>
<div class="wrapper">
<h1>Kemaskini Maklumat Pelajar</h1>
<?php
echo "<pre>";
print_r($_POST);
echo "</pre>";
echo $affected_rows ." jumlah rekod telah diedit<br/>";
?>
<br/>
<a href="index.php" class="button-link btn-grey">KEMBALI KE SENARAI</a>
</div>
</body>
</html>