<!DOCTYPE HTML><HTML> <Head> <MetaCharSet= "Utf-8"> <title></title> <styletype= "Text/css">Table{width:800px;Height:1px solid Red;Border-collapse:collapse; }Table TR th,table TR TD{Border:1px solid Red;size:12px; } </style> <Scriptsrc= "Js/jq8.js"></Script> <Script> //The JQ test environment is problematic in the 1.8.3,2.x versionjQuery.fn.extend ({qx:function(){ This. attr ('checked',true); }, BX:function(){ This. attr ('checked',false); }, FX:function(){ for(varI=0; I< This. Length;i++){ if( This[i].checked== true){ This[i].checked= false; }Else{ This[i].checked= true; } } } }); $(function(){ $('#btnqx'). Bind ('Click',function(){ $(': CheckBox'). QX (); }); $('#btnbx'). Bind ('Click',function(){ $(': CheckBox'). BX (); }); $('#btnfx'). Bind ('Click',function(){ $(': CheckBox'). FX (); }); }); </Script> </Head> <Body> <formAction=""Method= "POST"> <Table> <TR> <th>Number</th> <th>Account</th> <th>Registration time</th> <th>Operation</th> </TR> <?php mysql_connect (' localhost ', ' root ', ') or Die (' Database connection failed '); mysql_select_db (' xsphp '); Mysql_set_charset (' UTF8 '); Assemble the SQL statement $sql = ' select * from admin limit 10 '; $res = mysql_query ($sql); while ($row = Mysql_fetch_assoc ($res)) {?> <TR> <TD><?php echo $row [' id '];?></TD> <TD><?php echo $row [' username '];?></TD> <TD><?php echo Date (' y-m-d h:i:s ', $row [' addtime ']);?></TD> <TD><inputtype= "checkbox"name= "id[]"value= "<?php echo $row [' id '];?>" /></TD> </TR> <?php}?> <TR> <TDAlign= "Right"colspan= "4"> <inputtype= "button"ID= "BTNQX"value= "Select All"> <inputtype= "button"ID= "BTNBX"value= "All is not selected"> <inputtype= "button"ID= "Btnfx"value= "Reverse Selection"> <inputtype= "Submit"name= "Sub"ID= "Btnok"value= "Bulk Delete"> </TD> </TR> </Table> </form> </Body></HTML><?php if ($_post[' Sub ']) {$id = $_post[' id ']; $ids = Implode (', ', $id); Bulk Delete $sql = "Delete from admin where ID in ($ids)"; Echo $sql; }?>
Kill Thunder Dog jquery---49 single selection, reverse election, all do not select the actual combat database information