in reply to Re: Comparing an array to a DBI table
in thread Comparing an array to a DBI table
I also notice you're handling your own errors and probably not using RaiseError on the connect. That's ok, but then you should also check for errors on the prepare and the execute.my $sql = 'select 1 from subscription where user_id = ?'; my $sth = $dbh->prepare($sql); foreach my $userid ... { $sth->execute($userid); my ($exists) = $sth->fetchrow_array; $sth->finish; if ($exists) { ... } }
|
---|