<?php
include '../koneksi.php';

$id = $_POST['id_peminjam'];
$nama = $_POST['nama_peminjam'];
$email = $_POST['email'];
$telp = $_POST['no_telp'];
$idbuku = $_POST['id_buku'];

$query = "UPDATE peminjam SET nama_peminjam='$nama', email='$email', no_telp='$telp', id_buku='$idbuku' WHERE id_peminjam='$id'";

if (mysqli_query($koneksi, $query)) {
    header('Location: ../peminjam.php?alert=Berhasil');
} else {
    header('Location: ../peminjam.php?alert=gagal');
}
exit();
?>
