How can I store Unchecked box data in database in PHP?How can I prevent SQL injection in PHP?How do I make a redirect in PHP?How do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?jquery set checkbox checkedCheck box values storing in different columns of database using php (In a loop)How to store details of dynamically generated check boxes in mysqlMutiple checkbox values is not stored to database in php, empty renty showing using foreach
Is the Levitate spell supposed to basically disable a melee-based enemy?
Did the US Climate Reference Network Show No New Warming Since 2005 in the US?
Is a paralyzed creature limp or rigid?
Is there a way to retrieve the “source code” and the argument pattern from a macro for reuse (i.e. what show shows)?
Why are all volatile liquids combustible
In-universe, why does Doc Brown program the time machine to go to 1955?
Numerical minimum of a one-valued function
Identifying the following distribution
How do I stop making people jump at home and at work?
Tying double knot of garbarge bag
Is it possible to observe space debris with Binoculars?
FORMAT returns large row size and data size
RAW, Is the "Finesse" trait incompatible with unarmed attacks?
How can I implement regular expressions on an embedded device?
How do you calculate the range of an attack when attacking diagonally?
Draw the ☣ (Biohazard Symbol)
How do I anonymously report the Establishment Clause being broken?
GFI outlets tripped after power outage
Never make public members virtual/abstract - really?
Ceiling fan electrical box missing female screw holes
French equivalent of "my cup of tea"
If I have an accident, should I file a claim with my car insurance company?
Is the interior of a Bag of Holding actually an extradimensional space?
Is a Wick rotation a change of coordinates?
How can I store Unchecked box data in database in PHP?
How can I prevent SQL injection in PHP?How do I make a redirect in PHP?How do I get PHP errors to display?How do you parse and process HTML/XML in PHP?Reference — What does this symbol mean in PHP?How does PHP 'foreach' actually work?jquery set checkbox checkedCheck box values storing in different columns of database using php (In a loop)How to store details of dynamically generated check boxes in mysqlMutiple checkbox values is not stored to database in php, empty renty showing using foreach
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
In PHP I used Multi check box in foreach loop, When I Unchecked then I want to count and store that data in Database and also for Checked data, so How can I do that?
And I've a condition for that it is...
If(checked)
Insert Present
Elseif(Unchecked)
Insert Absent
Check box is in foreach loop, so there is multiple checkbox with different names.
Here presently I store data for Checked, but I can't store data for Unchecked, so please help me to solve this problem.
php checkbox unchecked
add a comment |
In PHP I used Multi check box in foreach loop, When I Unchecked then I want to count and store that data in Database and also for Checked data, so How can I do that?
And I've a condition for that it is...
If(checked)
Insert Present
Elseif(Unchecked)
Insert Absent
Check box is in foreach loop, so there is multiple checkbox with different names.
Here presently I store data for Checked, but I can't store data for Unchecked, so please help me to solve this problem.
php checkbox unchecked
add a comment |
In PHP I used Multi check box in foreach loop, When I Unchecked then I want to count and store that data in Database and also for Checked data, so How can I do that?
And I've a condition for that it is...
If(checked)
Insert Present
Elseif(Unchecked)
Insert Absent
Check box is in foreach loop, so there is multiple checkbox with different names.
Here presently I store data for Checked, but I can't store data for Unchecked, so please help me to solve this problem.
php checkbox unchecked
In PHP I used Multi check box in foreach loop, When I Unchecked then I want to count and store that data in Database and also for Checked data, so How can I do that?
And I've a condition for that it is...
If(checked)
Insert Present
Elseif(Unchecked)
Insert Absent
Check box is in foreach loop, so there is multiple checkbox with different names.
Here presently I store data for Checked, but I can't store data for Unchecked, so please help me to solve this problem.
php checkbox unchecked
php checkbox unchecked
edited Mar 28 at 4:25


Zain Farooq
2,5553 gold badges12 silver badges32 bronze badges
2,5553 gold badges12 silver badges32 bronze badges
asked Mar 28 at 4:23
Aezaz DesaiAezaz Desai
33 bronze badges
33 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Lets go for pseudo logic for this.
Store a hidden variable with all the checkbox values.
e.g.
<input type="hidden" value="1,2,3,4,5,6,7,8,9" name="allCheckboxes"/>
In the form submit, you are already getting the checked values.
Say, you get 5,7,9
as checked. -> Present
You need then 1,2,3,4,6,8
as unchecked. -> Absent
This can be achieved through array and string operations between allCheckboxes
and checked checkboxes.
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390139%2fhow-can-i-store-unchecked-box-data-in-database-in-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Lets go for pseudo logic for this.
Store a hidden variable with all the checkbox values.
e.g.
<input type="hidden" value="1,2,3,4,5,6,7,8,9" name="allCheckboxes"/>
In the form submit, you are already getting the checked values.
Say, you get 5,7,9
as checked. -> Present
You need then 1,2,3,4,6,8
as unchecked. -> Absent
This can be achieved through array and string operations between allCheckboxes
and checked checkboxes.
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
add a comment |
Lets go for pseudo logic for this.
Store a hidden variable with all the checkbox values.
e.g.
<input type="hidden" value="1,2,3,4,5,6,7,8,9" name="allCheckboxes"/>
In the form submit, you are already getting the checked values.
Say, you get 5,7,9
as checked. -> Present
You need then 1,2,3,4,6,8
as unchecked. -> Absent
This can be achieved through array and string operations between allCheckboxes
and checked checkboxes.
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
add a comment |
Lets go for pseudo logic for this.
Store a hidden variable with all the checkbox values.
e.g.
<input type="hidden" value="1,2,3,4,5,6,7,8,9" name="allCheckboxes"/>
In the form submit, you are already getting the checked values.
Say, you get 5,7,9
as checked. -> Present
You need then 1,2,3,4,6,8
as unchecked. -> Absent
This can be achieved through array and string operations between allCheckboxes
and checked checkboxes.
Lets go for pseudo logic for this.
Store a hidden variable with all the checkbox values.
e.g.
<input type="hidden" value="1,2,3,4,5,6,7,8,9" name="allCheckboxes"/>
In the form submit, you are already getting the checked values.
Say, you get 5,7,9
as checked. -> Present
You need then 1,2,3,4,6,8
as unchecked. -> Absent
This can be achieved through array and string operations between allCheckboxes
and checked checkboxes.
answered Mar 28 at 4:27


PupilPupil
21.7k4 gold badges33 silver badges59 bronze badges
21.7k4 gold badges33 silver badges59 bronze badges
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
add a comment |
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
Here is my code: while($row = $result->fetch_assoc()) <input type="checkbox" name="att[]" value="<?php echo $row["enrollno"]; ?>" checked>
– Aezaz Desai
Mar 28 at 11:56
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55390139%2fhow-can-i-store-unchecked-box-data-in-database-in-php%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown