それは私のjqueryコードです:
$(function() {
$("#edit_union").click(function() {
var tuzove = $("#tuzove").val();
var description = $("#description").val();
var union_owner = $("#union_owner").val();
var union_name = $("#union_name").val();
var uid = $("#uid").val();
var dataString = 'tuzove='+ tuzove + '&description=' + description + '&union_owner=' + union_owner + '&union_name=' + union_name + '&uid=' + uid;
$.ajax({
type: "POST",
url: "ajax/admp_ajax.php",
data: dataString,
success: function() {
$(".adm_panel_serach_user").append("<br/><span style=' color: #0099ff; font-weight: bold;'>Success.</span>");
}
});
return false;
});
});
それは ajax/admp_ajax.php ページです:
include_once 'classes/admin_panel.php';
$admpanel = new adminPanal();
if ($_POST['tuzove'] && $_POST['description'] && $_POST['union_owner'] && $_POST['union_owner'] && $_POST['uid'])
$admpanel->editUnion($_POST['tuzove'], $_POST['description'], $_POST['union_owner'], $_POST['union_name'], $_POST['uid']);
それが editUnion 関数です:
public function editUnion($tyzove, $description, $ownerName, $unionName, $unionId) {
mysql_query("UPDATE `union` SET tuzove = '" . $tyzove . "', description = '" . mysql_real_escape_string($description) . "', owner_id = '" . $this->getUserId($ownerName) . "' WHERE name = '" . $unionName . "'");
if ($ownerName == $ownerName)
mysql_query("UPDATE users SET union_rank = '0', union_id = '0' WHERE username = '" . $ownerName . "'");
mysql_query("UPDATE users SET union_rank = '1', union_id = '" . $unionId . "' WHERE username = '" . $ownerName . "'");
}
問題は、edit_union ボタンをクリックすると、Success と書き込みますが、union :( を更新しないことです。