http://qs321.pair.com?node_id=120700


in reply to Re: sql select with array
in thread sql select with array

Or, if you're not stuck on using just $dbh->selectall_arrayref and your database supports placeholders, couldn' you do this?
$sth = $dbh->prepare("SELECT " . '? ' x $#selector . "FROM people WHER +E (fornavn LIKE '%$search%') or (eternavn LIKE '%$search%') or (cpr L +IKE '%$search%'", \%attr); #dunno if you can do the \%attr part... $sth->execute(@selector);
And then you've got a statement handle to get your data from.. I don't know if it's more efficient, but it seems a bit more readable to me.