Menu

Senin, 02 September 2019

Materi 7 Membuat file delete.php

<?php
                           
                           
include "koneksi.php";
$delete_id=$_GET['delete_id'];

echo "$delete_id";

$sql = "DELETE FROM siswa WHERE id=$delete_id";
if(mysqli_query($dbconnect, $sql)){
    echo "Records were deleted successfully.";
    echo "<script> location.replace('tampil.php'); </script>";
} else{
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($dbconnect);
}

// Close connection
mysqli_close($dbconnect);

?>

Tidak ada komentar:

Posting Komentar

Komentarlah dengan bijak no Spam