Results 1 to 2 of 2

Thread: Find records according to a list of words

  1. #1
    Join Date
    Jan 2013

    Question Find records according to a list of words

    Accoring to a string that contain words separated from a space, in mySql i need to search all records in which the title contains at least one those words.
    There are a specific syntax for do that, or i've to generate a WHERE IN (word1, word2, word3...) clause?
    And there are a solution basend on the LIKE clause?

    Searching on internet i found this solution too
    PHP Code:
    WHERE interests REGEXP 'sports|pub' 
    is that the better?

  2. #2
    Join Date
    Aug 2004
    Probably the best solution in terms of performance and functionality would be to set a FULLTEXT index on the column and use the related fulltext search functions.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center