Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical

Re^2: DBI search for forward slash

by luxs (Beadle)
on Nov 08, 2020 at 07:27 UTC ( #11123485=note: print w/replies, xml ) Need Help??

in reply to Re: DBI search for forward slash
in thread DBI search for forward slash

Yes, phpMyAdmin returns proper line with this request. I'm using MySql with MyISAM storage.

I can find in this table any string with one slash at the begining, but not in the middle of the string.

Replies are listed 'Best First'.
Re^3: DBI search for forward slash
by Corion (Patriarch) on Nov 08, 2020 at 08:08 UTC

    But = only compares for identity. You want LIKE, and you want the % placeholder:

    SELECT * FROM `texts` WHERE `string` LIKE '%/a/b/c%'

    ... or, with placeholders:

    SELECT * FROM `texts` WHERE `string` LIKE ?

    (and then in the ->execute() call, add the placeholders to your search string)

      LIKE is fail as well

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2022-07-04 05:17 GMT
Find Nodes?
    Voting Booth?

    No recent polls found