Hello everyone.
I have 4 tables whose Structures are provided with my question as snapshots
Table 1--> Students
Table 2--> Courses
Table 3--> Student_Courses
Table 4--> Users
I want 3 columns in the output which are.
1- Course
2- Classes Attempt
3- Classes Missed
Now :
--Only those courses should be shown which are associated with the login user.
--Classes Attempt & Classes Missed should be filtered out according to the courses associated with the user.
I am trying the following query
SELECT c.course_name, sc.st_classes_attempt, sc.st_classes_missed, st.stdnt_name
FROM courses c, student_attendance sc, students st
WHERE c.course_id = sc.c_id AND st.stdnt_rfid_tag = sc.st_id;
Can some one help me out?
Its showing a syntax error in php.
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 'c, student_attendance sc, students stWHERE c.course_id = sc.c_id AND st.stdnt_rf' at line 1