Location: PHPKode > scripts > Simple MySQL wrapper replicator > mysql.php
<?php 

class DB{ 
// MYsql Servers array

/////////////////////////////////////////////
	function sql($req){ 


$reslt='';
$servers=array(array('localhost','root','','dbtest'),array('localhost','root','','dbtest2'));
$base=0;

		while ($base<=count($servers)-1){

$dtbh= mysql_connect($servers[$base][0],$servers[$base][1],$servers[$base][2]);
$dtbs=mysql_select_db($servers[$base][3]) ;


	if ($dtbh AND $dtbs){
	if ($handll=mysql_query($req)){

$reslt= $handll;
 
}else
{
$reslt='error';
}
$base++ ; 
}
 }
return $reslt;
}
////////////////////////////////////////////////
//////////////////////////////////
}







?>
Return current item: Simple MySQL wrapper replicator