Home  >  Article  >  Backend Development  >  为什么$up只能到1,该如何解决

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

WBOY
WBOYOriginal
2016-06-13 09:58:37736browse

为什么$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('');
}
}

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

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn