dongtui9168 2018-08-09 14:43
浏览 61

Ajax php更新mysql

I want to update mysql records using ajax and php. i tested it works fine on local sever always but sometimes give error on live server please guide... What is wrong in this code sometimes work fine sometime gives error 505 bad getway or sometime 404 on live server........

Ajax function 
//=================== Save Data ============================
function savegData()
{
    var ProjectId='<?php echo $ProjectId;?>';
    var expertId='<?php echo $expertId;?>';
    $("#noverlay").fadeIn(100);
    alertify.success("Saving...");
    $.ajax({
        type:'POST',
        url:'../save.php',
        data:{Projectid:ProjectId,expertid:expertId,
                A1a1marks:$("#intellect1").val(),
                A1a2marks:$("#intellect2").val(),
                A1bmarks:$("#intellect3").val(),
                A1cmarks:$("#intellect4").val(),
                A1totalmarks:$("#sumIntellect").text(),
                A1comments:$("#commentIntellect").val(),
                A2amarks:$("#significance1").val(),
                A2bmarks:$("#significance2").val(),
                A2cmarks:$("#significance3").val(),
                A2dmarks:$("#significance4").val(),
                A2emarks:$("#significance5").val(),
                A2totalmarks:$("#sumSignificance").text(),
                A2comments:$("#commentSignificance").val(),
                A3amarks:$("#approach1").val(),
                A3bmarks:$("#approach2").val(),
                A3cmarks:$("#approach3").val(),
                A3dmarks:$("#approach4").val(),
                A3emarks:$("#approach5").val(),
                A3totalmarks:$("#sumApproach").text(),
                A3comments:$("#commentApproach").val(),
                B1amarks:$("#economic1").val(),
                B1bmarks:$("#economic2").val(),
                B1cmarks:$("#economic3").val(),
                B1dmarks:$("#economic4").val(),
                B1emarks:$("#economic5").val(),
                B1totalmarks:$("#sumEconomic").text(),
                B1comments:$("#commentEconomic").val(),
                B2amarks:$("#research1").val(),
                B2bmarks:$("#research2").val(),
                B2totalmarks:$("#sumResearch").text(),
                B2comments:$("#commentResearch").val(),
                B3amarks:$("#education1").val(),
                B3bmarks:$("#education2").val(),
                B3cmarks:$("#education3").val(),
                B3dmarks:$("#education4").val(),
                B3emarks:$("#education5").val(),
                B3totalmarks:$("#sumEducation").text(),
                B3comments:$("#commentEducation").val(),
                B4amarks:$("#collaboration1").val(),
                B4bmarks:$("#collaboration2").val(),
                B4cmarks:$("#collaboration3").val(),
                B4dmarks:$("#collaboration4").val(),
                B4emarks:$("#collaboration5").val(),
                B4fmarks:$("#collaboration6").val(),
                B4gmarks:$("#collaboration7").val(),
                B4hmarks:$("#collaboration8").val(),
                B4imarks:$("#collaboration9").val(),
                B4totalmarks:$("#sumCollaboration").text(),
                B4comments:$("#commentCollaboration").val(),
                Camarks:$("#infrastructure1").val(),
                Cbmarks:$("#infrastructure2").val(),
                Ccmarks:$("#infrastructure3").val(),
                Cdmarks:$("#infrastructure4").val(),
                Cemarks:$("#infrastructure5").val(),
                Ctotalmarks:$("#sumInfrastructure").text(),
                Ccomments:$("#commentInfrastructure").val(),
                Damarks:$("#reasonability1").val(),
                Dbmarks:$("#reasonability2").val(),
                Dc1marks:$("#reasonability3").val(),
                Dc2marks:$("#reasonability4").val(),
                Ddmarks:$("#reasonability5").val(),
                Dtotalmarks:$("#sumReasonability").text(),
                Dcomments:$("#commentReasonability").val(),
                totalmarks:GrandTotal,
                totalpercentage:percentage,

                piRecommended:$('#budgetRecommended1').val(),
                copiRecommended:$('#budgetRecommended2').val(),
                phd_studentRecommended:$('#budgetRecommended3').val(),
                ms_studentRecommended:$('#budgetRecommended4').val(),
                permanentEquipmentRecommended:$('#budgetRecommended5').val(),
                expendableSuppliesRecommended:$('#budgetRecommended6').val(),
                travelRecommended:$('#budgetRecommended7').val() ,

                LDIetcRecommended:$('#budgetRecommended8').val(),
                stationaryRecommended:$('#budgetRecommended9').val(),

                miscellaneousRecommended:$("#budgetRecommended10").val(),
                //otherRecommended:$('#budgetRecommended11').val() ,
                secretariatRecommended:$("#budgetRecommended11").val() ,

                indirectCostRecommended :$("#budgetRecommended12").val() ,
                totalRecommended:$('#totalRecommend').text(),

                piComments:$('#budgetReason1').val(),
                copiComments:$('#budgetReason2').val(),
                phd_studentComments:$('#budgetReason3').val(),
                ms_studentComments:$('#budgetReason4').val(),
                permanentEquipmentComments:$('#budgetReason5').val(),
                expendableSuppliesComments:$('#budgetReason6').val(),
                travelComments:$('#budgetReason7').val(),
                LDIetcComments:$('#budgetReason8').val(),
                stationaryComments:$('#budgetReason9').val() ,
                miscellaneousComments:$("#budgetReason10").val() ,
                secretariatComments:$("#budgetReason11").val() ,
                //Comments:$('#budgetReason11').val() ,
                indirectCostComments:$('#budgetReason12').val() ,
                decision:previousChecked
            },
              async:false,
        success:function(responce){
                    setTimeout(function()
                        {
                         alertify.success(responce);
                            $("#noverlay").fadeOut(200);
                         window.location='reviewReport.php?project_id='+ProjectId+'&expertid='+expertId;
                        },3000);
        },
       error: function (error) {
           $("#noverlay").fadeOut(200);
            console.log(error);
        },
    }); 

}
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 基于卷积神经网络的声纹识别
    • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
    • ¥100 为什么这个恒流源电路不能恒流?
    • ¥15 有偿求跨组件数据流路径图
    • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
    • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
    • ¥15 CSAPPattacklab
    • ¥15 一直显示正在等待HID—ISP
    • ¥15 Python turtle 画图
    • ¥15 stm32开发clion时遇到的编译问题