Měli byste nastavit replikaci MySQL (master/slave) a provádět dotazy pouze na hlavní DB. Viz dokumentaci:http://dev.mysql.com/ doc/refman/5.1/en/replication-howto.html
Pro pouhé 1 dotazování nahraďte řádek:
mysqli_query($db_connect2,"UPDATE ipserver SET ipsserver = ($db_connect1,"SELECT ipsserver FROM ipserver WHERE idserver = '11'") WHERE idserver = '11'");
s tímto kódem:
$result = mysqli_query(
$db_connect1,
"SELECT ipsserver FROM ipserver WHERE idserver='11'"
);
while ($row=$result->fetch_assoc()) {
$ipsserver = $row["ipsserver"];
mysqli_query(
$db_connect2,
"UPDATE ipserver SET ipsserver='$ipsserver' WHERE idserver='11'"
);
}