How to find related articles in MySQL?

Discussion in 'MySQL' started by dan101, Nov 29, 2010.

  1. #1
    I'd like to find related entries in MySQL database by looking for similar terms as the current article title.

    Say that I have in my db the following

    id title
    1 Some words here
    2 Separate tags using a comma
    3 You may add 5 tags to this thread
    4 Something else
    Code (markup):
    If the current article is
    $title='Separate tags using a comma';
    Code (markup):
    The related entry is You may add 5 tags to this thread because is containg one of the words - in our case tags

    Thanks
     
    dan101, Nov 29, 2010 IP
  2. iama_gamer

    iama_gamer Active Member

    Messages:
    404
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #2
    What about the second one saying seperate tags using a comma?? Which also contains tags??

    You can use explode function in php and then run a loop to get all the results
     
    iama_gamer, Dec 4, 2010 IP
  3. iama_gamer

    iama_gamer Active Member

    Messages:
    404
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    60
    #3
    Use LIKE '%tag word%' during the search
     
    iama_gamer, Dec 4, 2010 IP