PHP search

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
dazz1
Forum Newbie
Posts: 8
Joined: Wed May 14, 2003 8:45 pm

PHP search

Post by dazz1 »

ive tried FULLTEXT it it isnt what i wanted to get working, with my non fulltext search script let's say i search for:

super man

results liked super_man, super.man, ect... Don't show up, only results with super and man in them

but with FULLTEXT i search for super man I get results with the query super.man, super_man in them, BUT i also recieve result with super in them and not man

kinda hard to understand, is there a way i could use normal searching (non fulltexT) and make it so if somone searches for super man they receive results with super.man super0man, super-man
ect..

please help out...
McGruff
DevNet Master
Posts: 2893
Joined: Thu Jan 30, 2003 8:26 pm
Location: Glasgow, Scotland

Post by McGruff »

SELECT col1, col2, ..etc FROM table WHERE search_this_column LIKE '%super%' OR search_this_column LIKE '%man%'
User avatar
AVATAr
Forum Regular
Posts: 524
Joined: Tue Jul 16, 2002 4:19 pm
Location: Uruguay -- Montevideo
Contact:

Post by AVATAr »

are you using mysql? As of Version 4.0.1, MySQL can also perform boolean full-text searches using the IN BOOLEAN MODE modifier.

check this out: http://www.mysql.com/doc/en/Fulltext_Search.html
Post Reply