-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathedit.php
40 lines (26 loc) · 1.01 KB
/
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
<?php
include "class-database.php";
$db = new database();
//koneksi mysql via method
$db->koneksi();
if(isset($_POST[EDIT]))
{
$id = $_POST[ID];
$judul = $_POST[JUDUL];
$pengarang = $_POST[PENGARANG];
$penerbit = $_POST[PENERBIT];
$thn = $_POST[TAHUN_TERBIT];
$db->updateDataBuku($id,$judul,$pengarang,$penerbit, $thn);
}
//$db->bacaDataBuku($type, $id);
$id = $_GET[ID];
//echo $id;
?>
<form method="post" action="edit.php">
<input type="text" name="JUDUL" value="<?php echo $db->bacaDataBuku('judul',$id); ?>"><br>
<input type="text" name="PENGARANG" value="<?php echo $db->bacaDataBuku('pengarang',$id); ?>"><br>
<input type="text" name="PENERBIT" value="<?php echo $db->bacaDataBuku('penerbit',$id); ?>"><br>
<input type="text" name="TAHUN_TERBIT" value="<?php echo $db->bacaDataBuku('tahunTerbit',$id); ?>"><br>
<input type="hidden" name="ID" value="<?php echo $db->bacaDataBuku('id',$id);?>">
<input type="submit" name="EDIT" Value="EDIT"><br>
</form>