阅读背景:

严格的标准:从空值创建默认对象。

来源:互联网 

I have the following code.

我有以下代码。

        public function get_users_theme($uid)
            {
                    $r = $this->db2->query('SELECT * FROM users_theme WHERE user_id="'.$uid.'" LIMIT 1', FALSE);
                    if ($this->db2->num_rows($r) > 0) {
                            $o->user_theme = new stdClass();
                            $ut = $this->db2->fetch_object($r);
                            foreach($ut as $l=>$s) {
                                    $o->user_theme->$l  = stripslashes($s);
            }
                            return $o->user_theme;
                    } else {
                            return FALSE;
                    }
            }
        



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: