I have been trying to delete a record from a table using delete sql statement but I found it difficult. Can you please look at my code and see what might be wrong?
<?php
$name=$_REQUEST['student_id'];
$query=mysql_query ("delete from studentmark
where studentmark.CODE='$code' AND studentmark.student_id='$name'");
header('location:homet.php?action=studentsubject');
?>
CREATE TABLE IF NOT EXISTS `studentmark` (
`YEAR` int(4) NOT NULL,
`TERM` varchar(15) NOT NULL,
`CODE` varchar(7) NOT NULL,
`STUDENT_ID` varchar(255) NOT NULL,
`TEST` int(3) DEFAULT NULL,
`EXAM` int(3) DEFAULT NULL,
`TNAME` varchar(15) NOT NULL,
PRIMARY KEY (`CODE`,`STUDENT_ID`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;