How to search other related keywords?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

How to search other related keywords?

Post by amir »

Hello,

I am displaying different packages E.g. Romance, Break Fast, Parking etc. in my hotel site. I want to search these packages and display hotels in which these packages reside. Its working fine.

My Question is:-
we have a package Romance, other related keywords might be
Love, For Two, Excitement, Romanticism, Sexual Pleasure, Enjoy Two etc.

I want, if I make a search Romance but it does not exist then it should look for other related keywords and display the hotels according to them. How can I do this?

Please Advise.
TIA!
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Change line 84 in file query.php to use the third variable and then... :roll: </sarcasticGit>

How am I supposed to advise you on this? I don't know your code. Make an attempt and if it doesn't work post some code and we'll help you.
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

Actually I just want to have some idea or a starter! Thanks;
User avatar
louie35
Forum Contributor
Posts: 144
Joined: Fri Jan 26, 2007 8:40 am
Location: Dublin
Contact:

Post by louie35 »

you want to do something like Google suggest.

Create a table in your database and add similar words in it
eg:
Package: Romancesimilar words (not the same as the one that is in the search already) - Love, For Two, Excitement, Romanticism, Sexual Pleasure, Enjoy Two

so if I look for Love then show Related words Romance: For Two, Excitement, Romanticism, Sexual Pleasure, Enjoy Two
amir
Forum Contributor
Posts: 287
Joined: Sat Oct 07, 2006 4:28 pm

Post by amir »

You all are real gurus. Thanks!
Post Reply