You can go one better than this, even...
use PHP to construct a single SQL query
using the IN( ) comparator, ie:


// NOTE: this assumes that 0 is never a valid id; I just
// stuck it in to make the comma-delimiting come out right
$query = "DELETE FROM tablename WHERE id IN ( 0";

foreach($_POST["del"] as $val)
    $query .= ', '.$val;

$query .= ' )';

[close connection]


"Olinux" <[EMAIL PROTECTED]> wrote in message
> to make it a little better, make one connection to the
> db before you loop and then close the connection
> [connect]
> foreach loop
> [close connect]

PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to