Re: Checkboxes to gather rows to delete
| From: | Lewis Watson | Date: | Mon, 24 Feb 2003 16:43:32 +0000 |
| Subject: | Re: Checkboxes to gather rows to delete | ||
| References: | 1 2 3 4 5 6 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-25878@lists.php.net to get a copy of this message | ||
Hi there,
I have double checked the column names....Its giving me a Warning: Bad
arguments to implode() error....
Thanks.
Lewis
----- Original Message -----
From: "1LT John W. Holmes" <holmes072000@charter.net>
To: "Lewis Watson" <php@visionsix.com>; <php-db@lists.php.net>
Sent: Monday, February 24, 2003 10:36 AM
Subject: Re: [PHP-DB] Checkboxes to gather rows to delete
> > Thanks..... The below code returns each ID in an array like so...
> > Array ( [0] =>101 [1] => 201 ). Thanks for the help!
> > Lewis
> >
> > $teacherID = $_POST[teacherID];
> > $deleteID = $_POST[deleteID];
> >
> > if(isset($delete_teacher)) {
> > This is where I should loop through checking for the chosen ones
to
> > delete.....
>
> $query = "DELETE FROM table WHERE teacherID IN (" .
implode(',',$deleteID) .
> ")";
> mysql_query($query);
>
> > }
> >
> > <form action="" method="POST">
> > print "<input type=checkbox name=\"deleteID[]\"
> > value=\"$row[teacherID]\">";
> > print "<input type=submit name=\"delete_teacher\" value=\"Delete
the
> > Checked Teachers\">";
>
> Make sure the column names are correct, but that's it.
>
> ---John Holmes...
>
>