Results 1 to 2 of 2
Mar 5, 2013, 15:12 #1
- Join Date
- Jul 2011
- 0 Post(s)
- 0 Thread(s)
Select records from a table using checkbox
I have a weird requirement on a PHP app.
I have a table that is showing students that have taken a course in the past. The tables are setup like this
table 1: SCHEDULED COURSES
table 2: COURSE REGISTRATIONS (shows students that have registered for scheduled courses)
table 3: STUDENTS
The table right now shows students that took a specific scheduled course. All students get listed.
I need to tick each student that the instructor needs to print a card for (may or may not be all students) and then run a query to select only those students and export those to an excel spreadsheet.
Obviously its not as easy as doing a SELECT STUDENT ID because it needs to pull information specific to each course. I guess a LEFT JOIN would work but how to I work tick boxes into a query on the following page?
Mar 6, 2013, 09:22 #2
- Join Date
- Oct 2006
- France, deep rural.
- 17 Post(s)
- 1 Thread(s)
The html page showing the checkboxes would evolve from a join as you say.
You want student id and student name in order to output your check boxes eg:
<input type=checkbox name=students value=student /> Barbara Streisand <br />
SELECT s.student_id as id, s.student_name as name FROM students_table as s LEFT JOIN course_registrations_table as r ON s.students_id = r.students_id ORDER BY students_name