时间:2021-07-01 10:21:17 帮助过:32人阅读
$(document).ready(function(){ $("#usersubmit").click(function(){ $.post("addsinger.php", { singername : $("#singername").val() , area : $("#area").val() , sex : $("#sex").val() , singerimg : $("#singerimg").val() , singercid : $("#singercid").val() , singerfirstword : $("#singerfirstword").val() }, function (data, textStatus){ if(data=="success"){ window.location.reload() } } ); }) });
$singername=$_POST['singername'];$area=$_POST['area'];$sex=$_POST['sex'];$singercid=$_POST['singercid'];$singerimg=$_POST['singerimg'];$singerfirstword=$_POST['singerfirstword'];$connstr="DRIVER=Microsoft Access Driver (*.mdb);DBQ=".realpath("../mtv.mdb");$conn=odbc_connect($connstr,"","",SQL_CUR_USE_ODBC );$sql = "INSERT INTO singer (singer,singerarea,singersex,singercid,singerimg,singerfirstword) VALUES ('$singername','$area','$sex','$singercid','$singerimg','$singerfirstword')";$rs=odbc_do($conn,$sql);echo "success";
表是什么编码?
addsinger.php 文件的编码格式 和数据库的编码格式。请确定
ajax 总是以 utf-8 发送数据
access 只有 gbk 和 unicode 两种编码