views:

69

answers:

1

Here you have a screenshot from my table structure:http://img64.imageshack.us/img64/54/pictx.jpg

On my site I have two fields for the search, one for the city(ort) and one for industry(branche), and if I search for: Frankfurt verschierung, let's say that in the field for city I have: Frankfurt and in the field for industry(branche) I have verschierung it doesn't return any results, and I have the data in my database, here you have a pic from the data: http://img43.imageshack.us/img43/5632/pic2qf.jpg

And here you have my sql query:

$do = $this->select("*, MATCH(`ort`) AGAINST ('{$plz}') AS score")
           ->where('MATCH(`branche`) AGAINST( ? IN BOOLEAN MODE)', $branche)
           ->order('premium DESC, score');

Any solutions?

//EDIT

$do = $this->select("*,MATCH(`branche`,`ort`) AGAINST ('".$branche." ".$plz."') AS score")
    ->where('MATCH(`branche`,`ort`) AGAINST( ? IN BOOLEAN MODE)', $branche.' '.$plz)
    ->order('premium DESC, score');

Now if I search for the SAME terms, I get some results, BUT it doesn't display it correctly, here you have a picture from the search results: http://img704.imageshack.us/img704/183/pic3x.jpg

Only the FIRST result is corect what about the others? why are they there?!

A: 

SOLVED

$do = $this->select()
           ->where("`ort` LIKE ?",'%'.mysql_escape_string($plz).'%')
           ->where("`branche` LIKE ?",'%'.mysql_escape_string($branche).'%')
           ->order("premium DESC");

Thx for you're time!

Uffo
Maybe you could mark your answer as accepted so it doesn't stain your accept rate.
Daniel S
You shoud note, that this doesn't sort your result by relevance... ;)
Tomáš Fejfar