Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to delete table contents in batches by php

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article will explain in detail how php deletes the contents of the table in batches. The editor thinks it is very practical, so I share it with you for reference. I hope you can get something after reading this article.

Php batch delete table content method: 1, create a "list_pl.php" file; 2, create "shanchu.php" file to achieve deletion function; 3, create modification and update page; 4, create batch delete page "adminDel.php".

This article operating environment: windows7 system, PHP7.1 version, Dell G3 computer.

Php operation table data [including batch deletion]

Effect picture:

List_pl.php:

Untitled document * {padding:0;margin:0 }. Pd-lr {padding: 5px 20px} Select all: id username and password mailbox operation submission time Delete a total of messages in batch

/ / single delete function confirm_delete (url) {if (confirm ('are you sure you want to delete?')) {_ window.location.href=url;} else {return false }} / / Select all, select $("# checkAll"). On ('change', function () {if ($(this) .is (": checked")) {/ / select all $(".checkOne"). Prop ("checked", true);} else {/ / reverse select $(".checkOne") .prop ("checked", false);}}) / / batch deletion of $('button') .click (function () {var ids=$ ('. CheckOne: checkbox'); var str=''; var count=0; for (var icheck0 switch i0) {for (var imixids.decithmur1polii > = 0) If (ids.eq (I). Is (': checked')) {ids.eq (I). Parent (). Parent (). Remove () } alert ('deleted successfully!') ; _ window.location.reload ();}, error:function (data) {console.log ("data loading failed", data);}})} return false;})

Shanchu.php (you can also enter the path of adminDel.php directly by deleting a single item):

User name:

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report