求助php mysql数据更新问题
<?php
include("conn.php");
session_start();
$a=$_SESSION['ddh'];
$b=$_POST['mend'];
$xg="update dd set ssl='".$b."' where ddh='".$a."'";
mysql_query($xg) or die("错误");
if($xg==true)
{
echo "<script>alert('修改成功');location.href='indexs.php?lmbs=3';</script>";
}
else
{
echo "<script>alert('修改失败');location.href='indexs.php?lmbs=3';</script>";
}
?>
运行后,显示错误,请问错误在哪?谢谢
include("conn.php");
session_start();
$a=$_SESSION['ddh'];
$b=$_POST['mend'];
$xg="update dd set ssl='".$b."' where ddh='".$a."'";
mysql_query($xg) or die("错误");
if($xg==true)
{
echo "<script>alert('修改成功');location.href='indexs.php?lmbs=3';</script>";
}
else
{
echo "<script>alert('修改失败');location.href='indexs.php?lmbs=3';</script>";
}
?>
运行后,显示错误,请问错误在哪?谢谢
作者: zcfrank1st 发布时间: 2011-05-24
mysql_query($xg) or die("错误" . mysql_error() );
这样就知道了
这样就知道了
作者: xuzuning 发布时间: 2011-05-24
用了一楼说的函数显示:Fatal error: Call to undefined function mysql_erro() in E:\wamp\www\ms\xg.php on line 7
作者: zcfrank1st 发布时间: 2011-05-24
mysql_error()
作者: jordan102 发布时间: 2011-05-24