in reply to sql select with array
When you interpolate an array in a double quoted string, the elements of the array are separated by the contents of the $" variable. The default value for this variable is a space, so your SQL statement becomes "select fornavn efternavn cpr adresse zip city telefon mobil g_afsluttet bemyndigelse_til tjenestested id pic from people..." which is invalid SQL.
To fix the problem, you can set $" to a comma, but whenever you change the value of a Perl special variable, you should localise the change like this:
--{ local $" = ','; my $row = $dbh->selectall_arrayref("select @selector from people whe +re (fornavn like '%$search%') or (efternavn like '%$search%') or (cpr + LIKE '%$search%')",\ %attr); }
"The first rule of Perl club is you don't talk about Perl club."
|
|---|