代码如下
<?php
$newstu="insert into regstudent(username,stupswd,name,sex,stuidcard,stumobile,stuzone,stuadd,stupost,stuxx,stuzy,)value('$username','$stupswd','$name','$sex','$stuidcard','$stumobile','$stuzone','$stuadd','$stupost','$stuxx','$stuzy')";
if(mysql_query($newstu))echo "<script language=javascript>alert('注册成功');document.location.href('index.php');</script>";
else echo $newstu;
?>
可是信息填入后数据进不了数据库 为什么?
<?php
$newstu="insert into regstudent(username,stupswd,name,sex,stuidcard,stumobile,stuzone,stuadd,stupost,stuxx,stuzy,)value('$username','$stupswd','$name','$sex','$stuidcard','$stumobile','$stuzone','$stuadd','$stupost','$stuxx','$stuzy')";
if(mysql_query($newstu))echo "<script language=javascript>alert('注册成功');document.location.href('index.php');</script>";
else echo $newstu;
?>
可是信息填入后数据进不了数据库 为什么?
注意标点符号
2.values() 括号里面的 变量你用单引号 估计不太对吧我觉得你最好是打印输出一下sql语句 看看是否正确
改成values试试看 把数据放到数据库中试一试
2,输出sql语句看看,
3,讲你的输出的sql语句拿到mysql里面看看,看可以添加不?