match against mysql for more keywords

Discussion in 'PHP' started by w47w47, Oct 24, 2009.

  1. #1
    how to use the AGAINST () for more keywords? it must find the 2 keywords "two" and "words" even if they in this order "two words" also if the title is "two more words" then it must match too.

    WHERE MATCH (title,content) AGAINST ('two words')

    or

    WHERE MATCH (title,content) AGAINST ('%two%words%')

    or is there some other way?

    thank you, w47w47
     
    w47w47, Oct 24, 2009 IP
  2. mastermunj

    mastermunj Well-Known Member

    Messages:
    687
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    110
    #2
    the first one is correct. match against works on word to word basis and hence % are not required.
     
    mastermunj, Oct 24, 2009 IP
  3. w47w47

    w47w47 Peon

    Messages:
    255
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    ok, i tested it and it seems that both works... just don't know if the % can make some trouble.
     
    w47w47, Oct 24, 2009 IP