首页 > 数据库技术 > 详细

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

时间:2016-03-23 15:35:30      阅读:235      评论:0      收藏:0      [点我收藏+]

该错误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;
    }

 

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

原文:http://www.cnblogs.com/lvchenfeng/p/5311352.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!