Is this statement correct syntactically:
$query = "SELECT matric_no session course_name
FROM main_table session
WHERE main_table.matric_no = '$_POST[matric_no]'
AND session.session_name = '$_SESSION[session]'
AND session.course_name = '$_SESSION[course_name]'";
$result = mysql_query($query) ;
$duplicates = mysql_num_rows($result);
if ($duplicates = 1) {
echo "you have dis in the database";
};
there are some syntax problems in your query
if main_table and session are two different tables then it should be something like this.