<?php 
session_start();

include 'dbc.php';

$userid=$_SESSION["userid"];
$id=$_REQUEST["id"];



$sqll = "select * from notice3 where id='$id' and user_id='$userid'";
$data=mysql_query($sqll) or die ("Error:" . mysql_error());
$rows=mysql_num_rows($data);
$user_data=mysql_fetch_array($data);

  if($rows==0)
    {
	   $Message =  "This Record Cannot Deleted";
	    header("Location:notice3.php?Message={$Message}");
	  }
	  else
	  {
	  

$sql = "delete from notice3 where id='$id' and user_id='$userid'";
mysql_query($sql) or die("Error : " . mysql_error());

$Message = "Record Deleted";
    header("Location:notice3.php?Message={$Message}");
}

?>
