当前位置: 代码迷 >> PHP >> 为什么$up只能到1,该如何解决
  详细解决方案

为什么$up只能到1,该如何解决

热度:217   发布时间:2012-02-21 16:26:23.0
为什么$up只能到1
$up=0;
while(@$_GET['action']=='up'){

$up++;
$up_sql="update message set up='$up' where id=$_GET[id]";
if(mysql_query($up_sql)){
echo $up;
exit('<script language="javascript">alert("成功!");self.location = "admin.php";</script>');
}
}

------解决方案--------------------
$up_sql="update message set up=up+1 where id=$_GET[id]";
 
  相关解决方案