Advertisement

07.15.2008 at 06:23PM PDT, ID: 23568214
[x]
Attachment Details

MySQL string search

Asked by willsherwood in MySQL, PHP and Databases

In a PHP script, I have a text string (perhaps 200-300 chars):  $PHPString
and in MySQL i have a table of phrases, which can be single words or text strings perhaps up to 50-100 chars.

How is the best/most efficient way to see if any phrase is in the $PHPString?

SELECT ID FROM tblPhrases WHERE $PHPString=PhraseText

thanks
Start Free Trial
[+][-]07.15.2008 at 06:31PM PDT, ID: 22012625

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: MySQL, PHP and Databases
Sign Up Now!
Solution Provided By: matthewstevenkelly
Participating Experts: 2
Solution Grade: A
 
 
[+][-]07.15.2008 at 06:33PM PDT, ID: 22012635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]07.15.2008 at 06:34PM PDT, ID: 22012642

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]07.15.2008 at 06:44PM PDT, ID: 22012690

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628