Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: DBD-SQLite Regexp

by kennethk (Monsignor)
on Nov 26, 2012 at 18:08 UTC ( #1005732=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    SELECT  ID,
            sentence  
    FROM    texts
    WHERE   sentence LIKE '% $query %'
    
  2. or download this
    SELECT  ID,
            sentence  
    FROM    texts
    ...
       OR   sentence LIKE '$query %'
       OR   sentence LIKE '% $query'
       OR   sentence = '$query'
    
  3. or download this
    SELECT  ID,
            sentence  
    FROM    texts
    WHERE   sentence LIKE '%$query%'
    
  4. or download this
    my $sth = $dbh->prepare(<<'EOSQL');
    SELECT  ID,
            sentence  
    ...
    while (my @row = $sth->fetchrow_array) {
        push @$results, \@row if $row[1] =~ /\b\Q$query\E\b/;
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1005732]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2014-09-21 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (168 votes), past polls