Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/230.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Javascript不更新数据库_Php_Javascript_Jquery - Fatal编程技术网

Php Javascript不更新数据库

Php Javascript不更新数据库,php,javascript,jquery,Php,Javascript,Jquery,我有一个编辑配置文件,用于用户的配置文件。好吧,Javascript似乎只获得了这个时代的形式的价值。PHP文件正在老化,但没有其他文件,并且它没有更新数据库 Javascript: function UpdateProfile() { var newage = $("#NewAge").val(); var newimage = $("#NewImage").val(); var newbio = $("#NewBio").val(); var dataString = 'ne

我有一个编辑配置文件,用于用户的配置文件。好吧,Javascript似乎只获得了这个时代的形式的价值。PHP文件正在老化,但没有其他文件,并且它没有更新数据库

Javascript:

function UpdateProfile() {
var newage = $("#NewAge").val();
var newimage = $("#NewImage").val();    
var newbio = $("#NewBio").val();    
var dataString = 'newage=' + newage || 'newimage=' + newimage || 'newbio=' + newbio;    
if (newbio.length , newage.length , newimage.length == 0) {
    $('#Required').fadeIn(300);
    $('#Mask').fadeIn(300);     
} else {
    $.ajax({
        type: "POST",
        url: "update_profile.php",
        data: dataString,
        cache: false,
        success: function (UpdateProfile) {
            $('#EditInfo').hide();
            $("#UpdatedProfile").html(UpdateProfile);
            $("#UpdatedProfile").fadeIn('slow');
            $("#Age").html('Age: ' + newage);
            $('#Image').html('<img src="' + newimage +'" width="150" height="100" />');                                             
        }
    });
   }
}
更新此行:

 $newbio = $_POST['newabout'];

它应该会起作用。

试试这个:

$.ajax({
    ...
    data: { newimage: newimage,
            newage: newage,
            newbio: newbio }
   ...
});

哦,是的,之前忘了更改,但是没有,仍然输出这个。。更新成员集bio=()age=(18)image=()其中id='1',那么你能想到其他想法吗?
Success: Profile Updated!
UPDATE members SET bio=() age=(18) image=() WHERE id='1'
 $newbio = $_POST['newabout'];
 $newbio = $_POST['newbio'];
$.ajax({
    ...
    data: { newimage: newimage,
            newage: newage,
            newbio: newbio }
   ...
});