Page 1 of 1

Sticky Mysql query issue driving me nuts!

Posted: Sun Jan 23, 2005 12:33 am
by dpomije
I've got a games mysql database with a search function. The problem is, the proper names of the games are ones like "Half-Life 2" or "Call of Duty: United Offensive"

When someone does a search for "half life 2" without the dash, or "call of duty unitied offensive" without the colon, the result will not show up.

Is there a way to construct a query that will basically match the result even if the user doesn't enter a colon, dash or whatever character?

this is what I'm doing currently. Very simple as you can see.

$query = "select NAME OF GAME from GAME TABLE where NAME OF GAME like '%$user query%'

I would appreciate any insight. If you're a gamer and a coder, help me out!

Posted: Sun Jan 23, 2005 12:40 am
by feyd
search around on "full-text searching"

Posted: Sun Jan 23, 2005 1:42 am
by AGISB
Besides full text searching you can also splitt the search into words and use like with each of the words.