in reply to Re: DBI, quoting, and LIKE searches
in thread DBI, quoting, and LIKE searches

Aha! It works. But, will this have the performance problems associated with using place holders and saying $sth->execute->("foo%")? It mentioned here that it didn't use the Index like it should. I'm not a database expert, so I don't know how to test this.

Replies are listed 'Best First'.
Re^3: DBI, quoting, and LIKE searches
by tye (Sage) on Dec 26, 2002 at 17:36 UTC

    Since these LIKE strings start with a '%', the database can't use an index at all. So that should not be a concern here.

            - tye
      I see... That solution will work great for my current problem then. But, for future reference, will it use the index like it should if the LIKE string does not start with a '%'?
        Yes, your database engine will use an index (if available and depending on your query, optimisor) when you do like 'bla%'. I did read the theory on this once, but have since forgot... i guess i should hop off to google now.. :-)