Forum Moderators: coopster

Message Too Old, No Replies

Using strpos() in WHERE clause

         

bear

9:16 pm on Jul 7, 2007 (gmt 0)

10+ Year Member



I'm new to PHP and this problem is causing problems

Can anyone one help with trying to devise a SELECT statement that gets records when the field "keyword1" containing a list of strings, is contained within a string "$mysearch

&mysearch = "one two three"

keyword1 - field in database
one
two
nine
seven
other

I have tried

$test = "SELECT * FROM Links WHERE (strpos('$mysearch',keyword1)>0)"

and various other versions TRUE etc.

Thanks,

what I want to do is to select rows 1 and 2 which have strings that are contained within "one two three"

bear

7:46 am on Jul 8, 2007 (gmt 0)

10+ Year Member



Thanks Folks,

I finally found the Mysql functions!

Thanks,