Please, stop “dumping” your code. As both @Paulie_D and I have said, it is very difficult to read through a large mass of code on the forum. When you need to post lots of code, use an online service like pastebin or github.
Secondly, there is no reason to make a code dump in this case. You say your question is about a checkbox —most of the code you have posted is going to be completely irrelevant to this problem, so why make everyone dig through it? Follow the forum guidelines and make a reduced test case that demonstrates your specific problem.
here check box is not getting value
You are aware that checkboxes only “get a value” when they are checked…? If the box is not checked, there will be no value. I don’t know if this is your problem or not, because you have not described your problem clearly.
- What do you mean by “not getting value”? Do you mean its key is not in the
$_POSTarray? it is, but the value you assigned is incorrect/missing?
- What actually happens when you run your code? do you get an error? are your records updated incorrectly? have you inspected the form submission directly (without trying to do the SQL, so you can determine if the input is correct or if it’s an SQL problem)?
I have tried to explain this before. If you do not provide this sort of information, it is very difficult to help. I you continue to ignore this advice and request, I will not be able to help you.
$sql1=”UPDATE “.$stud_info.” SET onoff=’”.$_POST["onoff".$id]…
Remember what I said about SQL Injection vulnerabilities? You’re doing it again.