<?php
include"../../../../inc/conn.php";

// CEK HAK AKSES DISINI

$id_media	= str_replace("'","`",(isset($_POST['id_media'])) ? $_POST['id_media'] : "");
$caption	= str_replace("'","`",(isset($_POST['caption'])) ? $_POST['caption'] : "");
$ukuran		= str_replace("'","`",(isset($_POST['ukuran'])) ? $_POST['ukuran'] : "");
$align		= str_replace("'","`",(isset($_POST['align'])) ? $_POST['align'] : "");


$update = mysqli_query($connect,"update tb_media set 

		caption	 		= '".$caption."',
		ukuran	 		= '".$ukuran."',
		align	 		= '".$align."'

	where id_media='$id_media'")or die(mysqli_error($connect));


if($update){
	echo"<script>alert('Media berhasil diperbarui !');</script>";
	echo"<script>document.location.href='datamedia'</script>";
}else{
	echo"<script>alert('Gagal mengeksekusi perintah ini !');history.go(-1)</script>";
}
?>