No added datainto database, and not shown in table append using AJAX and PHP

前端 未结 3 1288
执念已碎
执念已碎 2021-01-20 10:50

I am still in the same problem in this link here. So, I used the append method. And here is the AJAX code:



        
3条回答
  •  粉色の甜心
    2021-01-20 11:23

    [1] Why are you catching value of a button

    var selectW = $('#insert_new').val();
    

    I think there is no need for that.

    [2] Add this before ajax call

    dataString = 'selectW='+ selectW + '&select_at='+ select_at + '&pay='+ pay+ '&facture='+facture+ '&select_opt='+ select_opt;
    

    [3] In ajax call set `data' as

    data: dataString,
    

    instead of

     data: {'text': insert_new, 'text': selectW, 'text': select_at, 'text': pay, 'text': facture, 'text': select_opt},
    

    [4] Why are you catching response, you are not sending any string back from insert_buy.php

              if(response=="success")
              {
    

    as you are not getting return value as "success", else part is getting executed and getting alert message as "No data added".

提交回复
热议问题