Hi all.
I've got a little script that shows various info depending on the owner of
the info. I can currently delete every entry individually, but I'm wanting
to have a radio button for each entry which can be checked, then all checked
entries can be deleted.
here is the script which lists all the particular entries and produces a
radio button each entree.
<?php
//Get records for user $login
$query = "SELECT * FROM detail WHERE r_mail='$login'";
$result=mysql_query($query);
while ($data=mysql_fetch_array($result)) {
$recivedcards = $data["s_name"];
$id = $data["id"];
$view = $data["viewed"];
$show ="$recivedcards, $view <input type=radio name=id value=$id>";
echo "$show";
}
?>
As staded above, this script allows me to delete an entree one by one.....
but how do I create an array containing all the values for the checked '$id'
and then send the array off to delete the array?
Here is the current script for deleting the single $id..
<?php
if($delete) {
// delete a record
if(empty($id)) error_message("you have not selected any record to be
deleted");
$query = "DELETE FROM detail WHERE id='$id'";
$result = mysql_query($query);
?>
What will I need to change above in order for the script to be repeated
until the array containing all the $id is empty.
Thanks
I've tried.....
$todelete =array($id)
but this only returns the id for each record, not array(1, 2, 4, 5, 6) as I
would have expected.....