i try to update my table=voucher, but it was failed..here i submit my coding,...
<?php
session_start();
include "db1.php";
?>
<?php
if(isset($_REQUEST['add'])){
if (@!$_REQUEST['purpose2'] || @!$_REQUEST['pay_to2'] || !$_REQUEST['emp_2_2'] || !$_REQUEST['ecer2'])
{$display = "<font face='verdana' font siza='12' font color='#FF0000'>*Please enter all the particular ";
echo $display;
}
else
$purpose2 = '$_POST[purpose2]';
//Update records
$query = "UPDATE voucher
SET purpose ='$_POST[purpose2]'
WHERE emp_1 ='$_SESSION[emp_1]' '";
mysql_query($query) or die('Error, insert query failed');;
}
?>
<!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>edit.php</title>
</head>
<body>
<form method="post" name="edit.php" action="" id="form1" onsubmit="return confirm('Are you want to edit the E-Payment Voucher details ?">
<table width="400" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="200" height="27">Purpose</td>
<td width="200"><input type="text" name="purpose2" id="purpose2" /></td>
</tr>
<tr>
<td height="31">Pay To</td>
<td><input type="text" name="pay_to2" id=" pay_to2" /></td>
</tr>
<tr>
<td height="28">Company/Employee No</td>
<td><input type="text" name="emp_2_2" id="emp_2_2" /></td>
</tr>
<tr>
<td>E-Purchase#/E-CER#</td>
<td><input type="text" name="ecer2" id="ecer2" /></td>
</tr>
</table>
<p>
<input id="add" type="submit" value="Add Item" name="add" />
<input name="reset" type="reset" value="Reset" />
</p>
</form>
</p>
</body>
</html>
please help me....thanks in advanced