Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

fulltext-index; problem with join

Status
Not open for further replies.

BennySHS

Programmer
Mar 15, 2005
32
DE
Hi there,

I use a fulltext-index for searching my database.
The old query searched only in a table called 'user'. The old query was no problem, but now there another table I need to search too.

First my original query:

SELECT * FROM
tbl_user
WHERE MATCH (name, strasse, beschreibung, suchbegriffe) AGAINST ('$suchbegriffe' IN BOOLEAN MODE)
AND aid='$administrationId';


Now a user can have different branches, and this branches should be included in the search. And thats my problem, I dont't get it to work.

the tables:

tbl_user:
id|aid|name|phone|adress|country

the aid is the administration-id which the user belongs to.

tbl_branches
id|vid|thename

tbl_userrbranches
brancheid|userid

and the actual SQL-string which doesnt work correctly.

SELECT benutzer.name AS name
FROM
tbl_benutzer AS benutzer,
tbl_branchen AS bra,
tbl_benutzerbranchen AS bbra
WHERE MATCH
(bra.name, benutzer.name, benutzer.strasse, benutzer.beschreibung, benutzer.suchbegriffe)
AGAINST
('$suchbegriffe' IN BOOLEAN MODE) AND
benutzer.vid='$verwaltungId' AND
bra.vid ='$verwaltungId' AND
bra.id = bbra.branchenid;


I hope you can help me out,
thx in adavance,
greets ben
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top