Posted By

ricosushi on 07/20/10


Tagged

delete array inputs multiple


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

ricosushi


Delete multiples inputs


 / Published in: PHP
 

Deletes multiple records as in hotmail

  1. <?php
  2. // php
  3. if(!empty($_POST['array'])) {
  4. $list=array_keys($_POST['array']);
  5. if($_POST['boton_borrar']){
  6. $sqlD="DELETE FROM `registrados` where `id` IN (".implode(',',$list).")";
  7. mysql_query($sqlD) or die(mysql_error());
  8. }
  9. }
  10. ?>
  11.  
  12. // html
  13. <input type="checkbox" name="array[<?php echo $row['id'] ?>]">

Report this snippet  

You need to login to post a comment.