php checkall delete all records
-
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
-
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
Take a look at these : http://www.webmasterworld.com/forum88/11963.htm[^] http://www.browardphp.com/php_manual_en/html/faq.html.html[^]
-
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
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[^]