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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Searching two databases

Status
Not open for further replies.
Jun 9, 2004
188
US
Hello. I was asked to create a second knowledge base which pretty much consists of articles (id title description and the post). I am now have to make another one for restricted users. How would I change my sql to search both of these databases?

The first database is called 'article'. I have a second database called 'informationtech'.

Would I add 'AS score FROM article AND informationtech'?

"SELECT id,title,description,DATE_FORMAT(date,'%M %D, %Y') AS date,post, match(title, description) AGAINST ('$search_value' IN BOOLEAN MODE) AS score FROM article where match(title, description) against('$search_value' IN BOOLEAN MODE) ORDER BY score DESC"

Thanks much.,
 
use the format databaseName.tableName.fieldName and see that works

Bastien

Cat, the other other white meat
 
Huh?

How would that fit in the query. As score FROM DB1.tableName.fieldName AND DB2.tableName.fieldName



"SELECT id,title,description,DATE_FORMAT(date,'%M %D, %Y') AS date,post, match(title, description) AGAINST ('$search_value' IN BOOLEAN MODE) AS score FROM article where match(title, description) against('$search_value' IN BOOLEAN MODE) ORDER BY score DESC"

Thanks for the response
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top