php $conn->query数据添加不进去
<?phpsession_start();require_once("db.inc.php");require_once("allfuns.php");?><?php$e...
<?php
session_start();
require_once ("db.inc.php");
require_once ("allfuns.php");
?>
<?php
$email =@$_POST['email'];
$passwd =@$_POST['pwd'];
try {
$conn=db_connect();
$reslust =$conn->query("insert into user(email,password) valuse ('$email','$passwd') ");
echo $reslust;
if($reslust)
{
echo "yes";
}
else {
echo "no";
}
}catch(Exception $e)
{
$conn->close();
require_once('header.php');
require_once('foot.php');
exit();
}
?> 展开
session_start();
require_once ("db.inc.php");
require_once ("allfuns.php");
?>
<?php
$email =@$_POST['email'];
$passwd =@$_POST['pwd'];
try {
$conn=db_connect();
$reslust =$conn->query("insert into user(email,password) valuse ('$email','$passwd') ");
echo $reslust;
if($reslust)
{
echo "yes";
}
else {
echo "no";
}
}catch(Exception $e)
{
$conn->close();
require_once('header.php');
require_once('foot.php');
exit();
}
?> 展开
3个回答
2012-04-28 · 知道合伙人软件行家
关注
展开全部
因为代码不全,只能就已知代码说下原因,貌似是SQL语法错误:
insert into user(email,password) valuse ('$email','$passwd') "
应该是
insert into user(email,password) values ('$email','$passwd') "
即 valuse 单词拼写错误,应该是 values
insert into user(email,password) valuse ('$email','$passwd') "
应该是
insert into user(email,password) values ('$email','$passwd') "
即 valuse 单词拼写错误,应该是 values
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询