Can somebody tell me the PHP code and MySQL query so I can post radio buttons data into MySQL fields? I've a MySQL table called "Attendance" which has four fields:
- present
- absent
- leave
- holiday
My HTML form contain four radio buttons as well like
<input type="radio" name="present" value="1" /> <input type="radio" name="absent" value="2" /> <input type="radio" name="leave" value="3" /> <input type="radio" name="holiday" value="4" />
What I want is that if someone select absent radio button, then 2 should go to absent field in Attendance Table and other 3 fields will be empty in table; if someone select present then 1 should go to present field in Attendance and other 3 fields of absent leave holiday will be empty.
Also names are differents of 4 radio buttons, so there is problem that i can select all 4 radio buttons. How can I make them select one out of 4? I know if names are same then I have choice to select 1 but here is different issue, 4 different fields.