Search different databases
Moderator: General Moderators
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
Search different databases
hey, i want to do a search from different databases (it's the same for all of them), is for an automotive site.. Is there anyway I can merge in a search and search like 100 databases and display the resulst???
-
Maluendaster
- Forum Contributor
- Posts: 124
- Joined: Fri Feb 25, 2005 1:14 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
nonetheless, you are going to have to loop through each database, and select it.
I have never heard of any "easy" way to access multiple databases concurantly.
Code: Select all
$db = array('127.0.0.1' => 'some_database',
'127.0.0.2' => 'a_database') ;
foreach ($db as $host => $new_db)
{
mysql_connect($host,$user,$pass) or die(mysql_error());
mysql_select_db($new_db);
//run search here
}