check correct syntax
http://php.net/manual/en/function.mysql-query.php and http://www.php.net/manual/en/function.mysql-select-db.php
//SERVER 1
$link = mysql_connect("localhost","usern1","pw1");
mysql_select_db("db_one1", $link);
$query = "INSERT INTO db1(subject, search, News, img) VALUES('$hsubject','$key','$news','$img')";
$result = mysql_query($query, $link);
if(mysql_num_rows($result) == 0) {
$sentOk = "The data has been added to the database.";
echo "sentOk=" . $sentOk;
}
//SERVER 2
$link = mysql_connect("xxx.xxx.xx.xxx","usern2","pw2");
mysql_select_db("db_one2", $link);
$query = "INSERT INTO db2(subject, search, News, img) VALUES('$hsubject','$key','$news','$img')";
$result = mysql_query($query, $link);
if(mysql_num_rows($result) == 0) {
$sentOk = "The data has been added to the database.";
echo "sentOk=" . $sentOk;
}