Sticky Mysql query issue driving me nuts!
Posted: Sun Jan 23, 2005 12:33 am
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!
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!