SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    LIKE too restrictive

    Is there any other function that will select rows from a table where the results are similiar to specified keywords but produce broader results? I have noticed with using LIKE you really have to be specific with the keywords, cause it doesn't produce many results. Maybe my code is set up wrong...

    PHP Code:
    $SearchQuery "SELECT id, title FROM blogs_content WHERE blog_id = '$blog_id' AND title LIKE '%$keywords%'"
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you explain the problem better? Perhaps what you are searching for and how you would like the results to show up would help.

    Looking for %dog% will find dogcatcher and makeadogoutofyou
    but won't find cat or mississippi right?

  3. #3
    SitePoint Zealot
    Join Date
    Feb 2005
    Location
    UK
    Posts
    121
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    What you are probably after is full text search . You will need to read through all the sections to fully understand how to use full text search, and you may want to change some of the sever settings. Pay particular attention to the section on building the full text indexes, it trips a lot of people up. Also have a look at the section on query expansion as that may be very usefull to you.


Bookmarks

Posting Permissions

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