I am trying delete data from table, the form method is post. The url http://localhost/RustoleumCustomCMS2/administrator/input_image.php?mode=delete&id=0 (passing mode = delete and id = 0). I wonder why nothing happen. It suppose to delete a row in the database.
include('../includes/koneksi.php');
$id = isset($_POST['id']) ? $_POST['id'] : '';
$judul = isset($_POST['judul']) ? $_POST['judul'] : '';
$image = isset($_POST['image']) ? $_POST['image'] : '';
$confirmation = isset($_POST['confirmation']) ? $_POST['confirmation'] : '';
//Hapus image
if (!empty($_REQUEST['mode'])&& !empty($_REQUEST['id']) && $_REQUEST['mode'] == "delete"){
$id = $_REQUEST['id'];
$result = mysql_query("DELETE FROM gallery WHERE id =".$id) or die(mysql_error());
$confirmation = $result ? "Data successfully deleted." : "fail to delete data.";
}