Boolean Searching Help Please

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Subliminal
Forum Commoner
Posts: 40
Joined: Thu Oct 23, 2003 8:12 pm

Boolean Searching Help Please

Post by Subliminal »

Hey there!

New to the whole searching thing with MySQL so I thank you all very much..

below is my query and everything seems to work fine except when I through numbers into the equation.

For exmaple

Code: Select all

<?php

$searchfield = "something -3423";

$result = mysql_query("SELECT * FROM t9 WHERE MATCH path, name AGAINST ('$searchfield' IN BOOLEAN MODE)"); 
?>
This would completely ignore the numbers and bring up everything that has 'something' in the field including fields containing '3423' The numbers are not stored in their own column.

The columns are varchars no longer then 255 chars and I need them to contain both text and letters. (i say this because I think this is where my problem is) so is there another type i should be using... or is the searching really not as easy as I think....

oh and is possible to do a boolean search where you search for "some" and get results that are "something"

Just as you would do using LIKE \%

Thanks a million guys!!!!!!!!!!!!!!! and gals!!!!!!!!
Post Reply