I got this error when i want to click on details:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'and sq.testid=5),0) as om from student as s,test as t, subject as sub,studenttes' at line 1
$result=executeQuery("select s.stdname,s.nume_student,s.prenume_student,
t.testname, t.testdesc,sub.subname,sub.subdesc,sub.an,
DATE_FORMAT(st.starttime,'%d %M %Y ') as stime,
DATE_FORMAT(st.starttime,' %H:%i:%s') as stimes,
TIMEDIFF(st.endtime,st.starttime) as dur,
(select sum(marks)
from question
where testid=".$_REQUEST['details'].") as tm,
IFNULL((select sum(q.marks)
from studentquestion as sq, question as q
where sq.testid=q.testid and sq.qnid=q.qnid
and sq.answered='answered' and sq.stdanswer=q.correctanswer
and sq.stdid=".$_REQUEST['stdid']."
and sq.testid=".$_REQUEST['details']."),0) as om
from student as s,test as t, subject as sub,studenttest as st
where s.stdid=st.stdid and st.testid=t.testid
and t.subid=sub.subid and st.stdid=".$_REQUEST['stdid']."
and st.testid=".$_REQUEST['details'].";") ;
I know that the problem is sq.stdid=".$_REQUEST['stdid']."
and st.stdid=".$_REQUEST['stdid']."
but i have no idea how to resolve it.