JOIN работает внутри вашей БД, он не может сделать это к другой базе данных. В таких случаях делается 2 запроса, выбираем все нужные area - на php как пример выбираем через array_unique - только уникальные city_id, делаем запрос к базе данных с city where in (city ids) - назначаем чтобы ключ массива был city_id, в любой момент получаем город для area по типу такого: $city[$area->city_id]      <?php 
function writeTextOnImage($filename, $text, $text2)  
{   
    $size_img = getimagesize($filename);  
    if ($size_img[2]==2)       $src_img = imagecreatefromjpeg($filename);  
    else if ($size_img[2]==1)  $src_img = imagecreatefromgif($filename);  
    else if ($size_img[2]==3)  $src_img = imagecreatefrompng($filename);    
    // устанавливаем цвет нашей надписи и прозрачность (тут он будет синий и полностью прозрачный)
    $color = imagecolorallocatealpha($src_img, 255, 255, 255, 0);  
    $font_file = "font.ttf";  // шрифт, которым пишем надпись (будьте внимательны с путем к шрифту)
    $img_x = imagesx($src_img); 
    $img_y = imagesy($src_img);     
    $height_font = 30; // размер шрифта 
    $angle = 0;  // наклон надписи
  $iddmg = $_GET['idd'];
     
    // Запись текста поверх изображения  
    imagettftext($src_img, $height_font, $angle, $img_x - 670, $img_y - 300, $color, $font_file, $text); 
    imagettftext($src_img, $height_font, $angle, $img_x - 570, $img_y - 200, $color, $font_file, $text2); 
    // Вывод изображения в браузер  
    if ($size_img[2]==2)  
    {  
        header ("Content-type: image/jpeg");  
        imagejpeg($src_img, 'images/'.$iddmg.'.jpg');
        imagejpeg($src_img);		
    }  
    else if ($size_img[2]==1)  
    {  
        header ("Content-type: image/gif");  
        imagegif($src_img);  
    }  
    else if ($size_img[2]==3)  
    {  
        header ("Content-type: image/png");  
        imagepng($src_img);
        imagejpeg($src_img, 'images/'.$iddmg.'.png');		
    }  
    return true;  
} 
// использование 
$name = $_GET['name'];
$name2 = $_GET['name2'];
$ran_dom = rand (1 , 17);
$img = "img/".$ran_dom.".png"; // путь к изображению
writeTextOnImage($img, $name, $name2);  // тут "тект" - это наш текст, который будет поверх картинки
?>textAreaText.replace(выделенный текст, новый текст)
<form method="post" action="">
    <input type="hidden" name="action" value="save">
    <span></span>
    <button type="button" class="btn btn-primary">Сохранить</button>
</form>$(document).ready(function() {
            $('.btn').click(function() {
                var p = $(this).parent(),
                    form = p.serialize();
                $.ajax({
                    type: "POST",
                    url: "ajax.php",
                    data: form,
                    success:function(html){
                        p.children('span').html(html);
                    }
                });
            });
        });include("bd.php");
if (isset($_POST['Mark']) && !empty($_POST['Mark'])) {
    $result = mysql_query("UPDATE `marktable` SET `Mark` = '" . $_POST['Mark'] . "' WHERE `id` = 13");
    if ($result) {
        echo 'ok';
    } else {
        echo 'no';
    }
}<form action="" method="POST">
    <input type="text" name="Mark">
    <input type="submit" value="Сохранить">
</form>var http = new XMLHttpRequest();
          http.open("POST", "/send/index.php", true);
          http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
          http.send("name=" + this.name.value + "&email=" + this.email.value + "&tel=" + this.tel.value + "&question=" + this.question.value);
          http.onreadystatechange = function() {
          if (http.readyState == 4 && http.status == 200) {
            alert(http.responseText +', Ваше сообщение отправлено.\nСпасибо!');
            setTimeout(function() { location.href='/'; }, 1500);
          }
          }
          http.onerror = function() {
          alert('Извините, данные не были переданы');
          }
          return false;
          
        }window.onload = function() {
            document.getElementById('ask-form').onsubmit = function(){
 
                var http = new XMLHttpRequest();
                http.open("POST", "/send/index.php", true);
                http.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
                http.send("name=" + this.name.value + "&email=" + this.email.value + "&tel=" + this.tel.value + "&question=" + this.question.value);
                http.onreadystatechange = function() {
                    if (http.readyState == 4 && http.status == 200) {
                        alert(http.responseText +', Ваше сообщение отправлено.\nСпасибо!');
                        setTimeout(function() { location.href='/'; }, 1500);
                    }
                }
                http.onerror = function() {
                    alert('Извините, данные не были переданы');
                }
                return false;
            }
        };