PHP向mysql 输入数据,显示成功,但是查询不到 10
$mingcheng=$_POST['mingcheng'];$ddusername=$_POST['ddusername'];$fangshi=$_POST['fang...
$mingcheng=$_POST['mingcheng'];
$ddusername=$_POST['ddusername'];
$fangshi=$_POST['fangshi'];
$ip=$_POST['ip'];
$spid=$_POST['spid'];
$pic=$_POST['pic'];
$duihuanshu=$_POST['duihuanshu'];
$xingming=$_POST['xingming'];
$shouhuodizhi=$_POST['shouhuodizhi'];
$email=$_POST['email'];
$lianxidianhua=$_POST['lianxidianhua'];
$lianxiqq=$_POST['lianxiqq'];
$qitashuoming=$_POST['qitashuoming'];
$shuoming=$_POST['shuoming'];
$sj= date("Y-m-d H:i:s");
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
die(ERR_DB);
}
mysql_select_db($dbname);
mysql_query("set names 'utf8'");
$q = "insert into ".$BIAOTOU."dhdingdan (mingcheng,ddusername,fangshi,ip,spid,pic,duihuanshu,xingming,shouhuodizhi,email,lianxidianhua,lianxiqq,qitashuoming,addtime,shuoming,dhsh) values('$mingcheng','$ddusername','$fangshi','$ip','$spid','$pic','$duihuanshu','$xingming','$shouhuodizhi','$email','$lianxidianhua','$lianxiqq','$qitashuoming','$sj','$shuoming','0')";
mysql_query($q);
$q = "update ".$BIAOTOU."user set dhsh=1 where ddusername='".$ddusername."'";
mysql_query($q);
$q = "update ".$BIAOTOU."dhlist set shuliang=shuliang-1 where id='".$spid."'";
mysql_query($q);
echo "<script language=javascript>alert('兑换成功!工作人员将于三天内审核后发货!');window.history.go(-1);</script>";
mysql_close($link);
这是代码,结果显示成功,但是数据库里查不到,高手帮帮 展开
$ddusername=$_POST['ddusername'];
$fangshi=$_POST['fangshi'];
$ip=$_POST['ip'];
$spid=$_POST['spid'];
$pic=$_POST['pic'];
$duihuanshu=$_POST['duihuanshu'];
$xingming=$_POST['xingming'];
$shouhuodizhi=$_POST['shouhuodizhi'];
$email=$_POST['email'];
$lianxidianhua=$_POST['lianxidianhua'];
$lianxiqq=$_POST['lianxiqq'];
$qitashuoming=$_POST['qitashuoming'];
$shuoming=$_POST['shuoming'];
$sj= date("Y-m-d H:i:s");
$link = mysql_connect($dbserver, $dbuser, $dbpass);
if (!$link) {
die(ERR_DB);
}
mysql_select_db($dbname);
mysql_query("set names 'utf8'");
$q = "insert into ".$BIAOTOU."dhdingdan (mingcheng,ddusername,fangshi,ip,spid,pic,duihuanshu,xingming,shouhuodizhi,email,lianxidianhua,lianxiqq,qitashuoming,addtime,shuoming,dhsh) values('$mingcheng','$ddusername','$fangshi','$ip','$spid','$pic','$duihuanshu','$xingming','$shouhuodizhi','$email','$lianxidianhua','$lianxiqq','$qitashuoming','$sj','$shuoming','0')";
mysql_query($q);
$q = "update ".$BIAOTOU."user set dhsh=1 where ddusername='".$ddusername."'";
mysql_query($q);
$q = "update ".$BIAOTOU."dhlist set shuliang=shuliang-1 where id='".$spid."'";
mysql_query($q);
echo "<script language=javascript>alert('兑换成功!工作人员将于三天内审核后发货!');window.history.go(-1);</script>";
mysql_close($link);
这是代码,结果显示成功,但是数据库里查不到,高手帮帮 展开
4个回答
展开全部
$q = "update ".$BIAOTOU."dhlist set shuliang=shuliang-1 where id='".$spid."'";
mysql_query($q);
这个ID 明显有问题 除非你是字符串内容 那我就没什么话说了 ID肯定是数字 就不需要单引号了
mysql_query($q);
这个ID 明显有问题 除非你是字符串内容 那我就没什么话说了 ID肯定是数字 就不需要单引号了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
把SQL语句单独拿出来,在数据库里试试能不能出结果
一般来讲拼写错误居多
比如字符串要用引号什么的
仔细检查检查吧
一般来讲拼写错误居多
比如字符串要用引号什么的
仔细检查检查吧
追问
我是新手啊,怎么在数据库里运行?
追答
安装个mysql-front
将mysql可视化操作的一个程序
你值得拥有
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
建议仔细检查一下。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
用echo把两条SQL语句输出来,然后拿到数据库里运行一下,我觉得是你的SQL语句写错了,尤其是第二个SQL语句要那么多引号吗?而且你的引号打的不成对.
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询