在 $result=mysql_query($strSql,$mycon) or die(mysql_error());前 加echo $strSql; 检查一下SQL语句有没错误,SQL语句改成如下试试: $strSql="update product set userid='$current_user',kind='$kind',factory='$factory',name='$name',type='$type',config='$config', number='$number',baseprice='$baseprice',etprice='$etprice', re='$re',date='$date' where id ='$id'";
如果还是一样的话,我怀疑你的字段句:number,date,type可能会有问题
少一个"分号" $strSql="update product set userid='$current_user',kind='$kind',factory='$factory',name='$name',type='$type',config='$config', number='$number',baseprice='$baseprice',etprice='$etprice', re='$re',date='$date' where id ='$id';";
将$result=mysql_query($strSql,$mycon) or die(mysql_error()); echo "<br><br><br><center>您已经成功修改了库存信息!<br><br><br><br><ahref=\"lookup.php\">查看库存信息</a></center>";改为:$result=mysql_query($strSql) or die(mysql_error()); if ($result) { echo "<br><br><br><center>您已经成功修改了库存信息!<br><br><br><br><ahref=\"lookup.php\">查看库存信息</a></center>"; }还有就是检查一下在同一页面中,是不是有多个相同的变量名称,尽量避免出现相同的,要不会很麻烦。
在 $result=mysql_query($strSql,$mycon) or die(mysql_error());前
加echo $strSql;
检查一下SQL语句有没错误,SQL语句改成如下试试:
$strSql="update product set
userid='$current_user',kind='$kind',factory='$factory',name='$name',type='$type',config='$config',
number='$number',baseprice='$baseprice',etprice='$etprice',
re='$re',date='$date' where id ='$id'";
如果还是一样的话,我怀疑你的字段句:number,date,type可能会有问题
$strSql="update product set
userid='$current_user',kind='$kind',factory='$factory',name='$name',type='$type',config='$config',
number='$number',baseprice='$baseprice',etprice='$etprice',
re='$re',date='$date' where id ='$id';";
echo "<br><br><br><center>您已经成功修改了库存信息!<br><br><br><br><ahref=\"lookup.php\">查看库存信息</a></center>";改为:$result=mysql_query($strSql) or die(mysql_error());
if ($result)
{
echo "<br><br><br><center>您已经成功修改了库存信息!<br><br><br><br><ahref=\"lookup.php\">查看库存信息</a></center>";
}还有就是检查一下在同一页面中,是不是有多个相同的变量名称,尽量避免出现相同的,要不会很麻烦。
我想问你一个比较傻的问题,你之前连接数据库用的是那一个函数
mysql_connect ? mysql_pconnect?
最好把错误信息也贴出来!