3) php ничего не возвращает обратно
$(document).ready(function(){
$('button.btn-add').on('click', function() {
var bank_id = $(this).siblings('input.bank_id').val();
var id = $(this).siblings('input.id').val();
console.log(bank_id, id);
$.ajax({
method: 'POST',
url: 'cpl_offices_bank_id_by_name_ajax.php',
data: {id: id, bank_id: bank_id}
})
.done(function() {
$(this).closest('tr').remove();
}
)
}
)
})
SELECT `east`, `west`, `north`, `south` INTO t FROM `cpl_city` WHERE `id` = i
DROP PROCEDURE add_parent_id_to_city
DELIMITER //
CREATE PROCEDURE add_parent_id_to_city ()
begin
DECLARE i INT DEFAULT 4700;
DECLARE y INT;
WHILE i > 0 DO
SET y = SELECT `id` FROM `cpl_city` WHERE `east` <= (SELECT `east` FROM `cpl_city` WHERE `id` = i) AND `west` >= (SELECT `west` FROM `cpl_city` WHERE `id` = i) AND `north` <= (SELECT `north` FROM `cpl_city` WHERE `id` = i) AND `south` >= (SELECT `south` FROM `cpl_city` WHERE `id` = i);
UPDATE `cpl_city` SET `parent_id` = y WHERE `id` = i;
SET i = i - 1;
END WHILE;
END
//
Полный код того скрипта. Дело в том,что в функцию addOffice переменные $bank_site, $mfo_site тоже не передаются.