如果你的表是成绩一个表(stud_scor,学生资料一个表具体的查询如下stu_info:
当输入的是准考证时:sql ="select * from stud_scor where test_card= '".$testcard;
就ok了
当输入的身份证时,首先从资料表中得到学生的准考证号再进行查询就可以了
sql="select * from stud_scor where test_care in(select * from stu_info where identy_card =".$identycard;不知道楼主要的是什么东东