Click here to Skip to main content
15,039,021 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on a tiny project. This is the first time I will put my theory knowledge into hands on.

Table 1:

ID Name    Course code   Result
1 Rachel      1             1
2 Rachel       2             1 
3 John         1             1
4 John         2            1
Table 2:

Course code Name
1           Science
2           Math
Question: I have an HTML form, where I have radio button checklist with course names, how can I insert the assign the value of Course code from table 2 to that radio button checklist to record the data and then insert into Table 1?

I am using, HTML, PHP and SQL.

Any Help would be appreciated


What I have tried:

I am still going through a lot of videos, but not getting anywhere, I could use INSERT INTO SELECT, but not sure further from that.
Posted
Comments
Gerry Schmitz 1-Jun-21 15:40pm
   
You start by interpreting the radio buttons.

https://stackoverflow.com/questions/29542576/how-do-i-get-the-value-of-a-radio-button-in-php/45115882
W Balboos, GHB 3-Jun-21 9:57am
   
Radio buttons are used so you can limit selection to one of some number of elements.

For what you're doing (what if more courses are added) you'd be much better using a <select> list. As you add elements you don't have to change the page format because you don't have to add more radio buttons.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900