when I run following query i get the error
error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near
$query_rsDept = "SELECT * FROM result-ba where rollno =".$_REQUEST['Roll_No']." order by SUBORD";
You have a dash in your table name which is not allowed unless you use a delimited identifier. This mean you will need to wrap it in ticks:
SELECT * FROM `result-ba`
FYI, you are wide open to SQL injections.