Hi,
i cleaned up your code a little bit..
Are you sure that the item is in the session somewhere? Becaue you do not set it in this page. Also.. Why make the whole table a form, if you do not use it. You could just place the id of the item to be deleted in your delte form, instead of in a session?
Anyway. Some thoughts
<?php
include "db1.php";
session_start();
?>
<?php
if(isset($_REQUEST['delete'])){
$query ="DELETE from details where item = '.$_SESSION['item'].'";
mysql_query($query) or die(mysql_error());
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="post" action="">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<?php
// Select the data
$sql = "select *from details";
$query = mysql_query($sql);
$countData = mysql_num_rows($query);
// retrieve each row from the database, and place it into a table
$nt = mysql_fetch_array($query)
?>
<tr>
<td height="30" width="200">Item No </td>
<td width="200"><?php
echo $nt['item'];?>
</td>
</tr>
<tr>
<td height="30">Account No</td>
<td><?php
echo $nt['acc_no'];?>
</td>
</tr>
<tr>
<td height="30">Department Code </td>
<td><?php
echo $nt['depart_code'];
?></td>
</tr>
<tr>
<td height="104">Description</td>
<td><?php
echo $nt['descrip'] ;
?></td>
</tr>
<tr>
<td height="30">Amount</td>
<td><?php
echo $nt['amount'] ;
?>
</td>
</tr>
</table>
<td> </td>
<td> </td>
<br />
<table width="62" border="0">
<tr>
<td width="52"> </td>
</tr>
</form>
<form name="form2" action="aftersave.php" onsubmit="return confirm('Are you sure you want to delete!!')">
<input type="submit" name="delete" id="delete" value="Delete"/>
<a href="aftersave.php">Back</a>
</form>
</body>
</html>