php怎么向数据库增加数据

本文操作环境:windows7系统、php7.1版、DELL G3电脑

php怎么向数据库增加数据?

php往数据库添加数据

前端代码:

function submit_result() {             
                $.post(
                    "Controllers/ajaxController.php",
                    {
                        "name": $("#name").val(),
                        "mobile": $("#mobile").val(),
                        "score": $("#sp_score").html()
                    },
                    function(msg) {
                        if (msg == "0") {
                            layer.open({
                                content: '您已参与过该活动,下次再参与哦!',
                                btn: ['知道了']
                            });
                        } else {
                            layer.open({
                                content: '恭喜您,获得了,'+msg,
                                btn: ['知道了'],
                                end:function(){
                                    location.href="index.html";
                                }
                            });
                        }
                    }    
                );

PHP代码

=100) echo "一等奖";
        if($score<100&&$score>=60) echo "二等奖";
        if($score<60) echo "三等奖";
        exit;
    }
}
  
 
?>


网页题目:php怎么向数据库增加数据
文章URL:http://jxruijie.cn/article/cdsishs.html