Re: [PHP] PHP and MySQL Full Text Search Problem

2003-03-13 Thread Ray Hunter
Since you are using fulltext search it is going to look for the exact
spelling of what you pass in.

If you wanted to get matches with Chris then you will want to modify
your query by using LIKE.

In version 4.0.1 of mysql you can do fulltext search in boolean mode.

http://www.mysql.com/doc/en/Fulltext_Search.html (bottom of page).

--
Ray


On Thu, 2003-03-13 at 23:39, Charles Kline wrote:
> Hi all,
> 
> My first try at MySQL Full Text Search and it is not behaving ;)
> 
> Here is what I have for my query string:
> 
> $sql = "SELECT id, concat(fname, ' ', lname, ' ', degree1) as name".
> " FROM tbl_personnel WHERE MATCH (fname,lname) AGAINST ('" .
> $attributes['searchstring'] . "')";
> 
> 
> This works pretty good. The only problem is it only works if there is 
> an exact match for either the first name (fname) or last name. For 
> example. In tbl_personnel there are 5 people with the first name 
> Christine.
> 
> If I pass Chris to this query in $attributes['searchstring'] I get 0 
> results. If I pass Christine I get all 5.
> 
> What do I need to modify to make this work?
> 
> Thanks,
> Charles
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP and MySQL Full Text Search Problem

2003-03-13 Thread Charles Kline
Hi all,

My first try at MySQL Full Text Search and it is not behaving ;)

Here is what I have for my query string:

$sql = "SELECT id, concat(fname, ' ', lname, ' ', degree1) as name".
   " FROM tbl_personnel WHERE MATCH (fname,lname) AGAINST ('" .
   $attributes['searchstring'] . "')";
This works pretty good. The only problem is it only works if there is 
an exact match for either the first name (fname) or last name. For 
example. In tbl_personnel there are 5 people with the first name 
Christine.

If I pass Chris to this query in $attributes['searchstring'] I get 0 
results. If I pass Christine I get all 5.

What do I need to modify to make this work?

Thanks,
Charles
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php