Insert data through ajax into mysql database

后端 未结 6 1183
灰色年华
灰色年华 2020-11-30 06:33

Newsletter:

\">
6条回答
  •  半阙折子戏
    2020-11-30 06:39

    Try this:

      $(document).on('click','#save',function(e) {
      var data = $("#form-search").serialize();
      $.ajax({
             data: data,
             type: "post",
             url: "insertmail.php",
             success: function(data){
                  alert("Data Save: " + data);
             }
    });
     });
    

    and in insertmail.php:

    
    

    Don't use mysql_ it's deprecated.

    another method:

    Actually if your problem is null value inserted into the database then try this and here no need of ajax.

    
        
            
        
    
        Enter you email here:
        
        
    
    

提交回复
热议问题