질문Q #8091
CI 2.1.1버전/Oracle 에서 oci8_result.php 오류 발생시 대처법
불멸의새2012-06-21 16:09:23
CodeIgniter 2.1.1 버전으로 Oracle에서 작업시 아래와 같은 오류가 나옵니다.

Severity: Notice
Message: Undefined variable: rowcount
Filename: oci8/oci8_result.php
Line Number: XX 

원인은 oci8_result.php 버그입니다.

수정 파일 system/database/drivers/oci8/oci8_result.php

public function num_rows()
{
 if ($this->num_rows === 0 && count($this->result_array()) > 0)
 {
  $this->num_rows = count($this->result_array());
  @oci_execute($this->stmt_id);

  if ($this->curs_id)
  {
   @oci_execute($this->curs_id);
  }
 }

 return $rowcount;
}

위와 같은 코드가 있습니다.

여기서 return $rowcount; 을 return $this->num_rows; 으로 바꿔 주세요.

해당 함수 내에 정의되지 않은 $rowcount 변수를 리턴해서 발생하는 버그입니다.



답변2
#1 변종원(웅파) 2012-06-22 09:09:55
 발빠른 팁 감사합니다. ^^
#2 한대승(불의회상) 2012-06-22 10:17:57
좋은 정보 감사 합니다. ^^