SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    london
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hi im using php and mysql. On my html page, i dont know how to insert a multiple selection into a table, please help me out. i.e a student selects upt to 5 supervisors as his choice how do i insert the 5 choices for student id 1000 in a table


    In the database table this is how its should be:

    tbl_allocating
    Alloc_id | student_id | supervisor_id | allocated_flag
    1 1000 2000 NULL
    2 1000 2001 NULL
    3 1000 2005 NULL
    4 1000 2015 NULL
    5 1000 2004 NULL
    6 1001 2001 NULL

    many thanx
    Amor

  2. #2
    SQL Consultant gold trophysilver trophybronze trophy
    r937's Avatar
    Join Date
    Jul 2002
    Location
    Toronto, Canada
    Posts
    39,270
    Mentioned
    60 Post(s)
    Tagged
    3 Thread(s)
    Quote Originally Posted by amoresry
    how do i insert the 5 choices for student id 1000 in a table
    like this --
    Code:
    insert into tbl_allocating
     ( student_id , supervisor_id )
    values 
     ( 1000 , 2000 )
    ,( 1000 , 2001 )
    ,( 1000 , 2005 )
    ,( 1000 , 2015 )
    ,( 1000 , 2004 ) ;
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
    "giving out my real stuffs"

  3. #3
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    london
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hey r937 thanx for your help i will try that..

  4. #4
    SitePoint Enthusiast
    Join Date
    Jan 2005
    Location
    london
    Posts
    46
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    how do i submit my selected options from a selection list to another page without highlighting them


Bookmarks

Posting Permissions

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