i have a problem in updating the records...
it did'nt work... wats the prob with my update code...
i edit and when i update record nothing happens...
can any1 help me....
thnx and godbless!
<?php
header("location: index.php");
include("conn.php");
$mode=$_GET["mode"];
if($mode=="add") {
$MachineNo=$_POST["MachineNo"];
$MnfgDate=$_POST["MnfgDate"];
$sql="insert into $PRD(MachineNo,MnfgDate) values('$MachineNo','$MnfgDate')";
$result=mysql_query($sql) or die(mysql_error());
} elseif($mode=="update") {
$MachineNo=$_POST["MachineNo"];
$MnfgDate=$_POST["MnfgDate"];
$sn=$_POST["MnfgDate"];
$sql="update $PRD set MachineNo='$MachineNo',MnfgDate='$MnfgDate' where MnfgDate='$sn'";
//echo $sql;
$result=mysql_query($sql) or die(mysql_error());
header("location: index.php");
}
error_reporting(E_ALL);
?>