Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 1 of 1
  1. #1
    Regular Coder
    Join Date
    Jul 2008
    Posts
    195
    Thanks
    3
    Thanked 11 Times in 11 Posts

    Set Checkbox State

    OK. I need help please. My setup is so:
    I have 3 SQL tables, a students table, with a column for either of their 8 classes, and a username column. the username is how i track users and the classes column is filled with the Class_ID when the user is added to the class. My second table is the Classes table. it contains a class_id column and a period column (there are 8 periods in the day, A1-A4, B1-B4). My third table is the teachers table that stores the Teacher_Username as well as a column for each of their periods, populated with the appropriate class_id

    To add a student to a class, the Class_ID is placed into that students row in their appropriate period.

    I need to add users, but I can't figure out the checkboxes (I manually added some test users). The page lists all students and a check box next to the user to change their class membership. the form page before it sets the current period and teacher_username.

    I have queries to get the correct class_id by teacher_username and period from the teachers table, as well as to get the student username and period to be added to. (NOTE: A user is in the class when their period column value equals that of the Class_ID for that class).

    What I need is if the user is in the class, the box is already checked. If they are not in the class, the box is unchecked, each student has a checkbox... Can anyone help me on this? Would my current code help?

    Thanks so much!
    Last edited by macwiz; 07-10-2009 at 08:00 AM.
    -MacWiz1220
    Science fiction does not remain fiction for long. And certainly not on the Internet.
    -Vinton Cerf: Chief Internet Evangelist for Google and co-creator of the TCP/IP Internet Protocol Suite


 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •