I have a school report card management system, that allows teachers to add marks into the database.

But for the teacher to be able to insert marks into the database he/she needs to login and when He/she logs into the system he/she will find a list of students he/she teaches and the subjects he/she is teaching and the subjects he/she is teaching to those students.

I have this MySQL query, that retrieves the records from the database. Here is the problem; Teacher A who teaches subject X logs in and inserts marks for student Z, and after inserting the marks then logs out.Then Teacher B who teaches subject Y logs into the system, teacher B will find marks inserted by Teacher A on Subject Y even though, teacher B has not yet entered the marks.

Here is the MySQL code; [code] SELECT marks.test_1, students.id, students.student_id, students.student_name, subjects.subject_name, forms.form_name, teacherxsubject.form_id, students.class, teacherxsubject.subject_id, teacherxsubject.teacher_id FROM `students` LEFT JOIN teacherxsubject ON students.class = teacherxsubject.form_id LEFT JOIN marks ON students.student_id = marks.student_id LEFT JOIN subjects ON subjects.subject_id = teacherxsubject.subject_id LEFT JOIN forms ON forms.form_id = teacherxsubject.form_id WHERE teacherxsubject.teacher_id=192[/code]


JLCPCB – Prototype 10 PCBs for $2 (For Any Color)

China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB: https://bit.ly/2GMCH9w

Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir