I want to avoid to have 2 different contructions of $selection...Don't avoid it, don't worry about it. Just do it, e.g.:
my @filter; push @filter, "tag1 like '$value1'" if $value1; push @filter, "tag2 like '$value2'" if $value2; $sql .= "WHERE " . join(" AND ", @filter) if @filter;
In reply to Re: DBI SQLite statement problem with %
by runrig
in thread DBI SQLite statement problem with %
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |