function getRowsArray($sql){
                   $this->mysql_query_rst($sql);
                   if(mysql_errno() == 0){
                            while(
                            $row = mysql_fetch_array($this->result,MYSQL_ASSOC)) {
                                     $this->rowsArray[] = $row;
                            }
                            return $this->rowsArray;
                   }else{
                            return '';
                   }
         }
 同一页面执行第二次查询时和第一次的数据重叠在一起了,请高手帮忙解决下?

解决方案 »

  1.   

    function getRowsArray($sql){
      $this->mysql_query_rst($sql);
      if(mysql_errno() == 0){
      $this->rowsArray[] = array();
      while(
      $row = mysql_fetch_array($this->result,MYSQL_ASSOC)) {
      $this->rowsArray[] = $row;
      }
      return $this->rowsArray;
      }else{
      return '';
      }
      }
      

  2.   

    function getRowsArray($sql){
    $this->mysql_query_rst($sql);
    if(mysql_errno() == 0){
    $this->rowsArray = array();
    while($row = mysql_fetch_array($this->result,MYSQL_ASSOC)) {
    $this->rowsArray[] = $row;
    }
    return $this->rowsArray;
    }else{
    return '';
    }
    }把 []去掉就可以了,还是非常感谢,问题已解决