POST TIME:2020-04-13 22:32
代碼如下 | |
$this->dsql->ExecuteNoneQuery("UPDATE `dede_vote` SET totalcount='".($this->VoteInfos['totalcount']+1)."',votenote='".addslashes($items)."' WHERE aid='".$this->VoteID."'"); 修改為 $this->dsql->ExecuteNoneQuery("UPDATE `dede_vote` SET totalcount='".($this->VoteInfos['totalcount']+1)."',votenote='".mysql_real_escape_string($items)."' WHERE aid='".mysql_real_escape_string($this->VoteID)."'"); |
注:
* addslashes() 是強行加;
* mysql_real_escape_string() 會判斷字符集,但是對PHP版本有要求;(PHP 4 >= 4.0.3, PHP 5)
最好直接使用addslashes同時要查看你php是否默認(rèn)打開了addslashes這個自動功能哦,如果有了我們就不用加了。