Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Linux, Apache, MySQL, PHP
  4. php checkall delete all records

php checkall delete all records

Scheduled Pinned Locked Moved Linux, Apache, MySQL, PHP
helpphpdatabasetutorialquestion
3 Posts 3 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • U Offline
    U Offline
    umeshdaiya
    wrote on last edited by
    #1

    hi i would like to know how to solve the problem that i have some data on page and each records having checkbox box when i checkall all checkbox are checked and when i click on uncheckall all checkbox unchecked suppose user select all or select multicheckbox and there is also a button named delete all than all checked check will delete from database and show only remaining records on the page. thanks in advance? plz some one help me. :-D

    M R 2 Replies Last reply
    0
    • U umeshdaiya

      hi i would like to know how to solve the problem that i have some data on page and each records having checkbox box when i checkall all checkbox are checked and when i click on uncheckall all checkbox unchecked suppose user select all or select multicheckbox and there is also a button named delete all than all checked check will delete from database and show only remaining records on the page. thanks in advance? plz some one help me. :-D

      M Offline
      M Offline
      Mohammad Dayyan
      wrote on last edited by
      #2

      Take a look at these : http://www.webmasterworld.com/forum88/11963.htm[^] http://www.browardphp.com/php_manual_en/html/faq.html.html[^]

      1 Reply Last reply
      0
      • U umeshdaiya

        hi i would like to know how to solve the problem that i have some data on page and each records having checkbox box when i checkall all checkbox are checked and when i click on uncheckall all checkbox unchecked suppose user select all or select multicheckbox and there is also a button named delete all than all checked check will delete from database and show only remaining records on the page. thanks in advance? plz some one help me. :-D

        R Offline
        R Offline
        Ranjit Viswakumar
        wrote on last edited by
        #3

        When you check all or check many and POST the information, you'll want to processing script to take the POST values and process them one at a time. You can use the foreach() function to do this-

        foreach($_POST AS $field => $value) {
        mysql_query("DELETE FROM table WHERE $field='$value' LIMIT 1");
        }

        Make sure the name parameter of the checkbox is identical to the name of field (case-sensitive). This will cycle through and delete all rows where the fields are equal to the specified values. For more information, see- http://us2.php.net/foreach[^] Ranjit Viswakumar Professional Services Specialist rviswakumar@hostmysite.com HostMySite.com[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups