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;








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.










share|improve this question
































    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.










    share|improve this question




























      0












      0








      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.










      share|improve this question
















      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






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      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

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          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.






          share|improve this answer

























          • 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










          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
          );



          );













          draft saved

          draft discarded


















          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









          0
















          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.






          share|improve this answer

























          • 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















          0
















          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.






          share|improve this answer

























          • 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













          0














          0










          0









          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.






          share|improve this answer













          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.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          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

















          • 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








          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.



















          draft saved

          draft discarded
















































          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.




          draft saved


          draft discarded














          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





















































          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







          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

          Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript