/**
     +----------------------------------------------------------
     * 获得所有的查询数据
     +----------------------------------------------------------
     * @access private
     +----------------------------------------------------------
     * @return array
     +----------------------------------------------------------
     * @throws ThinkExecption
     +----------------------------------------------------------
     */
    private function getAll() {
        //返回数据集
        $result = array();
        if($this->numRows >0) {
         //$row = mysql_fetch_assoc($this->queryID);
            while($row = mysql_fetch_assoc($this->queryID)){
                $result[]   =   $row;
            }
            mysql_data_seek($this->queryID,0);
        }
        return $result;
    }
zendstudio 提示错误 Connot reduce access level for method ‘getAll';
还有 while($row = mysql_fetch_assoc($this->queryID)) 这个写法是不是可以改的更可读一点。

解决方案 »

  1.   

    可以考虑把getAll换成其他的函数名试一下,getAll可能是内部函数。
      

  2.   

    1 getAll()是私有方法, 不能在类外面调用 , 如果在类内部调用出错, 请粘出相关代码2 while($row = mysql_fetch_assoc($this->queryID)) 这个可读性没问题, 可能跟个人编程习惯有关
      (意思是, 把数据库源读成二维数组)