Help for this page

Select Code to Download


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