$select = $dbh->prepare(q(select foo, bar from baz)); $delete = $dbh->prepare(q(delete from baz where foo=? and bar=?)); $select->execute(); $select->bind_columns(\($foo, $bar)); while($ref = $select->fetchrow_arrayref()) { $delete->execute($foo, $bar) if $foo == 3; #<----this won't work }