版本引發的血案check the manual that corresponds to your MySQL server version for the right syntax


該錯誤mysql5.1有問題,mysql5.3版本沒問題

錯誤寫法:

private $t_poster;
    private $t_scene_id;
    
    private $tb_poster;
    private $tb_scene_id;
    
    public function __construct() {
        $this->t_poster = 'jiexiz_poster';
        $this->t_scene_id = 'jiexiz_scene_id';
        
        $this->tb_poster = tablename($this->t_poster);
        $this->tb_scene_id = tablename($this->t_scene_id);
    }

 
    public function get_poster_by_uniacid() {
        global $_W;
    
        $sql = "select * from " . $this->tb_poster . " where uniacid=:uniacid";
    
        $pars = array();
        $pars['uniacid'] = $_W['uniacid'];
    
        $exist = pdo_fetch($sql, $pars); //錯誤的寫法 

        if (!empty($exist)) {
            $exist = $this->decode_poster_param($exist, $exist['bgparam']);
        }
    
        return $exist;
    }

    public function get_poster_by_uniacid() {
        global $_W;
    
        $sql = "select * from " . $this->tb_poster . " where uniacid=:uniacid";
    
        $exist = pdo_fetch($sql, array(":uniacid"=>$_W['uniacid']));///正確的寫法

        if (!empty($exist)) {
            $exist = $this->decode_poster_param($exist, $exist['bgparam']);
        }
    
        return $exist;
    }

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM