delete.php 508 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
<?php 
 require_once '../Cn/koneksi.php';

 if($_SERVER['REQUEST_METHOD'] == 'POST')
 {
 	$pengumuman_id = $_POST['pengumuman_id'];

 	$query = "DELETE FROM pengumuman WHERE pengumuman_id ='$pengumuman_id'";

 	$exeQuery = mysqli_query($konek, $query); 

 	echo ($exeQuery) ? json_encode(array('kode' =>1, 'pesan' => 'berhasil Menghapus data')) :  json_encode(array('kode' =>2, 'pesan' => 'data gagal dihapus'));
 }
 else
 {
 	 echo json_encode(array('kode' =>101, 'pesan' => 'request tidak valid'));
 }

 ?>