Possible Duplicate:
How do you connect to multiple MySQL databases on a single webpage?
I am building a search engine for my website, I have 6 databases with many tables.
For multiple database I know I have to build a index file containing information from all database and tables.
I know how to build a search engine for database in PHP and MySQL,
Connect to multiple database
mysql_connect(“hostname”, “username”, “password”);
mysql_select_db(“database1”);
mysql_connect(“hostname”, “username”, “password”);
mysql_select_db(“database2”);
and query like this
"(SELECT * from database1.search_table WHERE MATCH (title, link) AGAINST(‘keyword’))
Union All
(SELECT * from database2.search_table WHERE MATCH (title, link) AGAINST(‘keyword’)"
I want to do it by making an index file.
Please suggest any good tutorial or method for this, I google many times but no good results.