該錯誤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; }