PART11
PART11
dengan Bootstrap 4
8. Buat file lagi dengan nama edit.php
<!DOCTYPE html>
<html>
<head>
<title>BARANG</title>
</head>
<link rel="stylesheet" type="text/css" href="assets/css/bootstrap.min.css">
<body>
<div class="container col-md-6 mt-4">
<h1>Table Barang</h1>
<div class="card">
<div class="card-header bg-success text-white ">
Edit Barang
</div>
<div class="card-body">
<?php
include('koneksi.php');
?>
<form action="" method="post" role="form">
<div class="form-group">
<label>Nama</label>
<!-- menampilkan nama
barang -->
<input type="text"
name="nama" required="" class="form-control" value="<?= $row['nama']; ?>">
<?php
?>
</div>
</div>
</div>
</html>
Lanjut klik link atau button edit dengan data yang ingin diubah :
9. Buat file terakhir dengan nama hapus.php
<?php
include 'koneksi.php'; //menghubungkan ke file
koneksi untuk ke database
$id = $_GET['id']; //menampung id
//query hapus
$datas = mysqli_query($koneksi, "delete from
barang where id ='$id'") or die(mysqli_error($koneksi));