Why is my delete query not deleting data from database?
This is the code:
<?php
include ("includes/database.php");
session_start();
if(!$_SESSION['username']){
header('location:index.php?error=You are not an administrator');
}else{
$delete_id=$_GET['id'];
$user=$_SESSION['username'];
$delete='delete from `wall` where `ID`="'.$delete_id.'" AND `User_id`="'.$user.'" ';
$Query=mysql_query($delete) or die (mysql_error());
if ($Query){
header('location:User_page.php');
}
}
?>
The query is working because I do a redirect to User_page.php
, but the data from database is not deleted.