- or download this
@textquery = ();
$text =~ s/[^\w\d\s\-]//g;
...
push @textquery, 'search_text LIKE ?';
push @data, '%' . $word . '%';
}
- or download this
UPDATE table SET search_text = CONCAT_WS(' ', name, headline, caption)
+;
- or download this
$text =~ s/[^\w\d\s'"\-]//g;
@words = parse_line('\s+', 1, $text);
- or download this
unless (@words) {
@words = split /\s+/, $text;
}
- or download this
SELECT x, y, z FROM table WHERE x REGEXP '[[:<:]]word[[:>]]'
- or download this
SELECT x, y, z FROM table WHERE x LIKE '%word%' AND x REGEXP '[[:<:]]w
+ord[[:>]]'
- or download this
foreach my $word (@words) {
if ($word =~ s/^(["'])(.+)\1$/$2/) {
...
push @data, '%' . $word . '%';
}
}