php代码中向mysql中插入数据为什么插不进去 15
<?phpinclude("Connections/myconn.php");//连接数据库mysql_select_db("a",$myconn);//选择数据库if(...
<?php
include("Connections/myconn.php");//连接数据库
mysql_select_db("a",$myconn);//选择数据库
if(isset($_POST['tj']))
{
$sql="insert into reader (fwm,name,readertype,cardtype,cardnum,dh,email) values ('".$_POST['fwm']."','".$_POST['name']."','".$_POST['readertype']."','".$_POST['cardtype']."','".$_POST['cardnum']."','".$_POST['dh']."','".$_POST['email']."')";
$result=mysql_query($sql);
if(!$result)
{
echo "<script> alert ('插入失败') </script>";
}
else
{
echo"<script> alert('插入成功');location.href='reder1.php'</script>";
}
}
?> 展开
include("Connections/myconn.php");//连接数据库
mysql_select_db("a",$myconn);//选择数据库
if(isset($_POST['tj']))
{
$sql="insert into reader (fwm,name,readertype,cardtype,cardnum,dh,email) values ('".$_POST['fwm']."','".$_POST['name']."','".$_POST['readertype']."','".$_POST['cardtype']."','".$_POST['cardnum']."','".$_POST['dh']."','".$_POST['email']."')";
$result=mysql_query($sql);
if(!$result)
{
echo "<script> alert ('插入失败') </script>";
}
else
{
echo"<script> alert('插入成功');location.href='reder1.php'</script>";
}
}
?> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询