I found it difficult to join multiple select statement in a query. if i select a single query it works fine but joining the select statement with union command shows nothing. what am i doing that is likely wrong.
$sel=mysql_query ("SELECT *
FROM studentmark join
student
ON studentmark.student_id = student.username join
subject
ON subject.code = studentmark.code
where student.username='$name' AND studentmark.YEAR = '$ya' AND
studentmark.TERM = 'THIRD')
//it works fine without using the union for a single query but joining the query there is nothing display
UNION(SELECT TOTAL AS secondterm
FROM studentmark
JOIN subject ON subject.code=studentmark.code
WHERE studentmark.student_id='$name'
AND studentmark.YEAR='$ya'
AND studentmark.TERM = 'SECOND')UNION(SELECT TOTAL AS firstterm
FROM studentmark
JOIN subject ON subject.code=studentmark.code
WHERE studentmark.student_id='$name'
AND studentmark.YEAR='$ya'
AND studentmark.TERM = 'FIRST'");
$fetch=mysql_fetch_array($sel);
$count=mysql_num_rows($sel);