record deletion using checkbox array values

From: Date: Wed, 08 Aug 2001 09:02:50 +0000
Subject: record deletion using checkbox array values
Groups: php.db 
Request: Send a blank email to php-db+get-11134@lists.php.net to get a copy of this message
Morning people, I have a form with checkbox values, if checked an array of id's are passed to a deletion script. I can get the array and implode to a string. Can anyone tell me how to delete all the messages in the DB that have the checked value. Presently the script is deleting only the last id value that has been checked. ---snip----- First the form: <input type=\"checkbox\" name=\"delete_list[]\" value=\"$id\"> submit etc.... Then the deletion script: <?php $delete=implode(",", $delete_list); if(!($result = mysql_db_query($DB, "DELETE FROM SENT_ITEMS WHERE ID = '$delete'"))) { DisplayErrMsg(sprintf("internal error %d:%s\n", mysql_errno(), mysql_error())); mysql_close($link); exit(); } ?> Been messing about with this one for a while now and I am getting a bit flustered! Thx in advance, Karl ========================== Karl Phillipson PHP SQL Programmer Saffron Hill Ventures 67 Clerkenwell Road London EC1R 5BL Saffron Hill: 0207 693 8300 Direct Line: 0207 693 8318

« previous php.db (#11134) next »