Creating multiple records

Creating multiple records

I need help! I'm trying to create multiple records in db based upon my checkbox field called class. I've tried to write the code but it isn't work. Is it possible for someone to assist me? I started off by checking to ensure that there is a value. If there is...then for each value create a record in the db.
 

  1. if (input.Class != Null){
  2.          for each key in input.Class
  3.         {
  4.             insert into Classwork_Tracker
  5.             [
  6. Added_User = zoho.loginuser
  7. Class = key.Class
  8.                 Bell_Ringer  = input.Bell_Ringer
  9. Homework=input.homeowork
  10.                 Class_Work = input.Class_Work
  11.                 Ticket_out_the_door=input.Ticket_out _the_door
  12.                 Date1 = input.Date1]
  13.             }
  14.  }