+ -
当前位置:首页 → 问答吧 → 关于《细说PHP》CMS项目中问题

关于《细说PHP》CMS项目中问题

时间:2011-05-15

来源:互联网

登录首页:出现这个notice,
Notice: Undefined variable: data in D:\Apache\htdocs\cms_demo\class\Article.class.php on line 125

Notice: Undefined variable: data in D:\Apache\htdocs\cms_demo\class\Article.class.php on line 141

Notice: Undefined variable: data in D:\Apache\htdocs\cms_demo\class\Article.class.php on line 162

Notice: Undefined variable: data in D:\Apache\htdocs\cms_demo\class\Flink.class.php on line 98

我查看了函数中的data, 为什么会告诉我没定义呢?不是明明直接赋值为数组啊。
function getRecommend($catId=0,$offset=0, $num=10){
            if($catId !=0 ){
                $sql = "SELECT id, title,author,postTime,audit FROM {$this->tabName}
                WHERE catId={$catId} and recommend=1  and audit=1 ORDER BY id DESC LIMIT $offset, $num";
            }else{    
                $sql = "SELECT id, title,author,postTime,audit FROM {$this->tabName}
                WHERE recommend=1  and audit=1 ORDER BY id DESC LIMIT $offset, $num";
            }

            $result=$this->mysqli->query($sql);

            while($row=$result->fetch_assoc()){
                $data[]=$row;
            }
            return $data;

而且主页样式也没连上。啥样式没有
图片:未命名.jpg
'700')this.width='700';if(this.offsetHeight>'700')this.height='700';" title="Click Here To EnLarge">

作者: fionadream   发布时间: 2011-05-15

楼主你看看你的项目路径,很有可能是路径不对,没加载到样式

作者: ba5eat   发布时间: 2011-05-15