MySQL searches...

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
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

MySQL searches...

Post by Todd_Z »

I have 4 tables that i need to search through for a user-specified word/phrase... whats the best way to do this and also, it needs to have a lot of room for people to screw up.... i.e. someone would be searching for an asian name, so it may be fairly off from what it actually is stored as in the table. Thanks in advance.

BTW - Don't make it simple... more complex the better, i only have basic knowledge of MySQL - I want to learn more
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

you might want to take a look at

viewtopic.php?t=24604&highlight=google+mean

and also generally searching for words in the database is used like this

Code: Select all

$sql = "SELECT * FROM `table` WHERE `content` LIKE '$yoursearch'";
might want to read up about it over at http://dev.mysql.com/doc/
User avatar
Todd_Z
Forum Regular
Posts: 708
Joined: Thu Nov 25, 2004 9:53 pm
Location: U Michigan

Post by Todd_Z »

Well... i can do the primitive, trivial searches - I'm looking for complicated algorithms...
User avatar
patrikG
DevNet Master
Posts: 4235
Joined: Thu Aug 15, 2002 5:53 am
Location: Sussex, UK

Post by patrikG »

A bit more advanced is MySQL's fulltext search, see viewtopic.php?t=21449&highlight=mysql+fulltext
Post Reply