版本引发的血案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;
    }

 

posted @ 2016-03-23 15:29  绿尘枫  阅读(14073)  评论(0编辑  收藏  举报